monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] binary_file hook


From: Daniel Carosone
Subject: [Monotone-devel] binary_file hook
Date: Tue, 25 Oct 2005 14:57:46 +1000
User-agent: Mutt/1.4.2.1i

On Sun, Oct 23, 2005 at 04:18:19PM -0700, Nathaniel Smith wrote:
> As a side note, there's a simple trick you can use for this sort of
> thing, in lack of anything better ATM...:
> 
> default_ignore_file = ignore_file

I tried applying this to the binary_file hook, to deal with the
example I had in mind when I posed the original question about
appending to internal hooks without copying the default
implementation:

default_binary_file = binary_file
function binary_file(name)
  if (string.find(name, "%-confg$")) then return false end
  return default_binary_file(name)
end

These files are Cisco router/switch configs. They're text, but they
contain some ^C characters, such as used for banner delimiters, so the
guess routine evidently decides they're binary.

No joy. Nothing I could do would make the hook match the files as
text. After some fussing around trying to figure out what kinds of lua
newbie syntax errors I had made, I eventually wound up with:

function binary_file(name)
  return false
end

(and no function renaming trick).  

monotone --debug says the lua file is being loaded, and I get lua
errors from loading it when I introduce syntax errors, but it seems
the hook isn't being called - no matter what I do, I still get
monotone diff telling me that some of the files are binary.  The files
aren't listed with any special attributes in .mt-attrs.

I've been working around this for quite some time using external diff,
which happily shows me the diffs.  I thought the tip given above would
be a better solution.

A more careful examination of TFM reveals that although a default
implementation of binary_file() is given, there's no documentation of
the hook itself -- suggesting that in fact it isn't likely to be
called.

So, how do I tell monotone these files are text?  

--
Dan.

Attachment: pgpw0xwANGcxe.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]