Timothy Brownawell <[email protected]> writes:

> On Sun, 2009-02-15 at 10:27 -0800, Zack Weinberg wrote:
>> What's the intended effect of the make_io_binary() call in
>> automate::exec()?  It looks like we're setting stdin and stdout to
>> binary mode for any automate operation, but that doesn't seem right --
>> if you're just running one automate command inside a batch file or
>> something you'd want DOS line endings, wouldn't you?
>
> get_file / get_file_of and put_file need to be binary-safe, so they work
> with binary files. stdio needs to be binary-safe, so the byte counts
> don't get messed up.
>
> The others probably don't care, but making them not binary (1) would be
> inconsistent, and (2) would mean that they'd give slightly different
> output when run through stdio. Not sure how much these points actually
> matter, especially for the commands that generate lists (tags,
> ancestors, inventory) rather than dumping items (get_current_revision).
>
> Perhaps default to binary for stdio and maybe get_file(_of)/put_file (or
> maybe not, since most files will probably be text files) and text for
> the others, with a --binary={yes|no} option to override this?

I always use editors that can deal with different line ending
conventions, so I'll never notice the difference. But it does seem
like giving the user control is a good idea.

Writing a convincing test for this will be complicated; you'll have to use
"if ostype = 'Windows'", rather than "canonicalize".


-- 
-- Stephe


_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to