[darcs-devel] darcs patch: bash completion made more robust regarding shell speci...

David Roundy droundy at abridgegame.org
Tue Dec 28 12:00:20 PST 2004


On Tue, Dec 28, 2004 at 05:39:25PM +0100, Guillaume wrote:
> Of this explanation, I suppose some bits could go into the detailed 
> comment of the patch, before I resubmit it (with the printf solution). 
> Which verbosity should I have there (mostly regarding the concrete 
> example)?

Thanks for your excellent explanation! Bash (or sh in general) really isn't
one of my best skills.  Amazingly enough, I did write the bash completion
code... but it took a lot of copying and trial and error.  :) And I've
avoided touching it ever since.

It's nice to have some explanation in the long comment for changes that
aren't quite obvious.  For really hard-to-understand changes, I sometimes
prefer to not include a complete explanation in the comment.  Particularly
in the case of subtle bug fixes, referring to the symptoms of the bug
rather than the solution seems fine.  It's mostly that when I'm feeling
responsible, I don't like to apply patches that I don't understand.

> By the way, while writing this all down, I thought I could do something 
> more robust using an IFS of $'\000', "à la" xargs -0, and preparing the 
> script to accept the output of a future darcs […] --list-option-0 ("à 
> la" find -print0). Who knows, carriage return is not forbidden as a 
> filename character…

Hmmm.  True, we could do that.  It'd seem like a bit of a shame though, to
add an extra flag to all commands, just to better support command-line
completion for silly people who have newlines in their filenames.

I wonder if it would be a good idea to support NUL-delimited output on more
commands? We could, for example, support it for annotate output (or the
hypothetical query command), which could be helpful when viewing a listing
of files in the repository.  If there are enough such uses (and enough
users for the uses) perhaps we should add a --nul-delimited flag that could
be used by various commands to modify their output.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list