Merge lp:~parthm/bzr/181124-ls-short-opts into lp:bzr
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Vincent Ladeuil on 2010-05-06 | ||||
| Approved revision: | 5200 | ||||
| Merged at revision: | 5216 | ||||
| Proposed branch: | lp:~parthm/bzr/181124-ls-short-opts | ||||
| Merge into: | lp:bzr | ||||
| Diff against target: |
133 lines (+21/-16) 4 files modified
NEWS (+4/-0) bzrlib/builtins.py (+8/-16) bzrlib/option.py (+3/-0) bzrlib/tests/test_help.py (+6/-0) |
||||
| To merge this branch: | bzr merge lp:~parthm/bzr/181124-ls-short-opts | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John A Meinel | 2010-04-29 | Approve on 2010-05-04 | |
| bzr-core | 2010-05-04 | Pending | |
|
Review via email:
|
|||
Commit Message
(parthm, #181124) short options for commonly used ls long options.
Description of the Change
=== Fixes Bug #181124 ===
Trivial patch to add some short options for 'bzr ls'
I have skipped --from-root as I couldn't think of a good short option. -l as mentioned in the bug report was confusion as 'ls -l' is commonly used.
| Matthew Fuller (fullermd) wrote : | # |
| Parth Malwankar (parthm) wrote : | # |
> > + Option('null', short_name='Z',
>
> -0 would be more fitting with similar options in oodles of other
> programs.
I was actually trying to be consistent with GNU grep but I don't have a specific preference. We can go with -0 if thats preferred.
| John A Meinel (jameinel) wrote : | # |
So our general guidelines were to only give short options to things that actually were used often, and to try to keep them consistent across all commands.
However, since Martin was the one who originally asked for us to be cautious about short options, and he's the one who posted the bug, and said that it should be done, I guess this is ok.
I personally prefer -0 for --null to -Z, but there doesn't seem to be a huge consensus in GNU land. xargs uses -0, find uses -print0, grep uses -Z...
Do we have other tools to include, since so far my sample size has each version happening exactly 1 time... :)
If you're going to be changing this, I would probably pull 'null' out into bzrlib.option, since it is used by cmd_added, and cmd_ignored (IIRC). I would like us to be consistent as much as possible.
Of course, some people have asked for -# w/ bzr.log to mean --last #, which would possibly conflict, but I don't think we can trivially support -# anyway (the option infrastructure would want us to create N options to support N variants of -#, though I'm sure we could do better with some deep work.)
So this is probably "BB:tweak", though I'll mark it needs-fixing as the best approximation.
| Matthew Fuller (fullermd) wrote : | # |
On Thu, Apr 29, 2010 at 03:36:59PM -0000 I heard the voice of
Parth Malwankar, and lo! it spake thus:
>
> I was actually trying to be consistent with GNU grep but I don't
> have a specific preference. We can go with -0 if thats preferred.
That can vary by the age and divergence of grep.
% man grep
[...]
--null Output a zero byte (the ASCII NUL character) instead of
[...]
-Z, --decompress
% grep -V
grep (GNU grep) 2.5.1-FreeBSD
| Parth Malwankar (parthm) wrote : | # |
> I personally prefer -0 for --null to -Z, but there doesn't seem to be a huge
> consensus in GNU land. xargs uses -0, find uses -print0, grep uses -Z...
>
> Do we have other tools to include, since so far my sample size has each
> version happening exactly 1 time... :)
>
bzr-grep uses -Z. It seems we are leaning towards standardizing -0/--null
for bzr. I can updated bzr-grep for this.
- 5197. By Parth Malwankar on 2010-04-30
-
--null is now a _standard_option
- 5198. By Parth Malwankar on 2010-04-30
-
added NEWS entry.
| Parth Malwankar (parthm) wrote : | # |
Thanks for the review comments John, fullermd.
-0/--null is now a _standard_option.
Updated commands ls, modified, and added to used this.
Looks like ignored doesn't take a null option.
Added a NEWS entry to "Improvements" as this is a user visible change.
| John A Meinel (jameinel) wrote : | # |
A very small thing that we don't use:
takes_options = [ 'null' ]
As our formatting. It should just be:
takes_options = ['null']
However, it looks good, and can be cleaned up at merged time.
- 5199. By Parth Malwankar on 2010-05-05
-
cosmetic fix as per coding practice.
- 5200. By Parth Malwankar on 2010-05-05
-
merged in changes from trunk and resolved conflict in builtins.py
| Parth Malwankar (parthm) wrote : | # |
> takes_options = ['null']
>
Done. I have also merged in trunk and resolved a conflict in builtins.py due to another mp being landed earlier.
| Parth Malwankar (parthm) wrote : | # |
Thanks Vincent.
I will land this patch.
- 5201. By Parth Malwankar on 2010-05-06
-
merged in changes from trunk.
- 5202. By Parth Malwankar on 2010-05-07
-
updated test_help to have --null (which is a standard option now)
- 5203. By Parth Malwankar on 2010-05-07
-
merged in changes from trunk.

> + Option('null', short_name='Z',
-0 would be more fitting with similar options in oodles of other
programs.