[MERGE] [#306424] Add trailing slash to directories in `bzr ls` output
Gordon P. Hemsley
gphemsley at gmail.com
Tue Dec 9 16:26:26 GMT 2008
Adding symbols beyond the slash was not the intention of this patch. In my
(brief) testing, no such situation occurred. Can you verify that you have
generated output with this patch that includes symbols such as @ or *? Also,
these changes pass all the unittests, once I change them to add slashes in
the appropriate places. I didn't add any other symbols to those tests.
Your concerns were already raised while I was discussing this on IRC. My
intent was to have addressed them already. Apologies if I haven't.
Let me know your results, then I'll make the appropriate changes.
On Tue, Dec 9, 2008 at 10:33 AM, John Arbash Meinel
<john at arbash-meinel.com>wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Gordon P. Hemsley wrote:
> > https://bugs.launchpad.net/bzr/+bug/306424
> > https://code.launchpad.net/~gphemsley/bzr/bug-306424-ls-trailing-slash<https://code.launchpad.net/%7Egphemsley/bzr/bug-306424-ls-trailing-slash>
> > This slightly changes the behavior of `bzr ls` to include trailing
> > slashes for all directories in all outputs. This was previously only
> > available using the verbose option, which also included file versioning
> > information. These small changes were made by making the pre-existing
> > code used with the verbose option apply to all options. The NEWS file
> > has been updated to reflect this change, as have the unittests.
> > I also fixed a small typo in the HACKING.txt file, unrelated to this bug.
> > --
> > Gordon P. Hemsley
> > gphemsley at gmail.com <mailto:gphemsley at gmail.com>
> > http://www.uvm.edu/~ghemsley/ <http://www.uvm.edu/%7Eghemsley/> •
> > http://cmsforme.sourceforge.net/ • http://www.yoursasha.com/
> So the one part that concerns me a lot is with "--null".
> As the --null flag is really meant for automated processing. Such as:
> bzr ls --null | xargs -0 ...
> And while adding a trailing '/' is generally harmless, adding @ and *
> break that situation.
> I see 2 options
> 1) Have an explicit flag for decoration (such as ls -F), possibly
> - --decorate, possibly something else. We could even default it to on as
> long as --no-decorate was available.
> However, it means that any time you want "bzr ls --null" you now also
> want "bzr ls --null --no-decorate".
> 2) Have --null automatically disable the decoration. Or possibly have it
> just change the default of "--no-decorate". You would do that in code with:
> def run(..., decorate=None):
> if decorate is None:
> if null:
> decorate = False
> decorate = True
> I'm not super happy when one option changes another options default, but
> I really don't see a case where people would want "bzr ls --null
> - --decorate".
> 3) I'm a bit concerned about changing the default output of "bzr ls"
> because it is (was?) meant primarily as a helper for people who were
> trying to script with bzr (hence why it has a flag like --null to
> produce unambiguous separation.) And changing the output tends to break
> automated scripts.
> I'm going to be a bit strong and vote
> I think there is something people would like here, but I feel like it
> shouldn't be the default behavior. People *can* do:
> bzr alias ls="ls --decorated"
> If they want it to be the default behavior.
> It would be *sufficient* for me to just not decorate "bzr ls --null",
> though I am still concerned about the other cases.
> PS> The specific code I'm concerned about is:
> elif null:
> - - self.outf.write(fp + '\0')
> + self.outf.write(outstring + '\0')
> if show_ids:
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> -----END PGP SIGNATURE-----
Gordon P. Hemsley
gphemsley at gmail.com
http://www.uvm.edu/~ghemsley/ • http://gpfactory.wyrihaximus.net/
http://cmsforme.sourceforge.net/ • http://www.yoursasha.com/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the bazaar