monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] line endings with 0.31


From: Nathaniel Smith
Subject: Re: [Monotone-devel] line endings with 0.31
Date: Mon, 20 Nov 2006 10:01:15 -0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Nov 20, 2006 at 10:55:27AM -0600, Kelly F. Hickel wrote:
> Hi all,
>       We're looking at possibly converting from CVS to MTN by the end
> of the year, and I have some questions.  At the moment, I'm a bit

Great!  Hope we can help.

> Questions:
> 
> 1) I see that I can specify a hook to control what line endings I want
> in my workspace versus db, is there a sample hook out there anywhere
> suitable for a linux hosted "master" db with development going on both
> on windows and unix?

The idea is that on unix, you do nothing.  And on windows boxen, you
must define:
  function get_linesep_conv(filename)
    return {"LF", "CRLF"}
  end

Note that this can be done in ~/.monotone/monotonerc (or mumble mumble
Application Data\Monotone or such on win32), to set the default for
all of a user's workspaces on that box, or it can be done in
_MTN/monotonerc in a particular workspace to affect only that
workspace.

> 2) Is there a way to designate a file as binary (or non-transformable)
> in 0.31? I didn't see one, I also didn't see any way for the hook to
> look at the filename to make a determination, did I miss something, or
> is there no way to do this today?

The get_linesep_conv hook is passed the filename, it can do whatever
it likes with it.  E.g.,
  function get_linesep_conv(filename)
    if regex.search("\\.jpe?g$", filename) then
      return {"LF", "LF"}
    end
    return {"LF", "CRLF"}
  end

I would like to hear more about what exactly your use case is, though.
The above stuff seems like it should work for you, but in fact the
line ending stuff is not (AFAIK) in very heavy use, the design was
done a long time ago and looks kind of weird and quirky by our current
standards.  So you may encounter some obscure bugs, and we'll probably
want to use your feedback to help redo the system :-).

-- Nathaniel

-- 
Details are all that matters; God dwells there, and you never get to
see Him if you don't struggle to get them right. -- Stephen Jay Gould




reply via email to

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