Re: [PATCH] parse-opt: migrate builtin-checkout-index.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] parse-opt: migrate builtin-checkout-index.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:30

Miklos Vajna [off-list ref] writes:
Signed-off-by: Miklos Vajna <redacted>
---

On Sat, Oct 18, 2008 at 03:17:23AM +0200, Miklos Vajna [off-list ref] wrote:
quoted
quoted
This adds a new feature to say --no-z from the command line, doesn't
it?
And I suspect the feature is broken ;-).
Right, I fixed this in option_parse_z(). --no-z should set
line_termination to \n instead of 1.
Originally in option_parse_z() I had

        line_termination = unset;

which is in fact right, because (as Pierre pointed out) unset for short
options are always false, but I changed it to

        line_termination = 0;

to make it more readable.
I think Pierre's comment is short-sighted.  Think of what would happen
when somebody adds "--nul" as a longer equivalent to "-z", since it is
extremely easy to do things like that with the use of parse-opt API?

Re: [PATCH] parse-opt: migrate builtin-checkout-index.

From: Pierre Habouzit <hidden>
Date: 2016-06-15 22:45:30

On Sun, Oct 19, 2008 at 08:11:31PM +0000, Junio C Hamano wrote:
Miklos Vajna [off-list ref] writes:
quoted
Signed-off-by: Miklos Vajna <redacted>
---

On Sat, Oct 18, 2008 at 03:17:23AM +0200, Miklos Vajna [off-list ref] wrote:
quoted
quoted
This adds a new feature to say --no-z from the command line, doesn't
it?
And I suspect the feature is broken ;-).
Right, I fixed this in option_parse_z(). --no-z should set
line_termination to \n instead of 1.
Originally in option_parse_z() I had

        line_termination = unset;

which is in fact right, because (as Pierre pointed out) unset for short
options are always false, but I changed it to

        line_termination = 0;

to make it more readable.
I think Pierre's comment is short-sighted.  Think of what would happen
when somebody adds "--nul" as a longer equivalent to "-z", since it is
extremely easy to do things like that with the use of parse-opt API?
Err I was only pointing out that --no-z would no nothing, I actually
didn't really read the argument :)  I didn't say having --null was a bad
idea, and I think we have -z/--null at a couple of places already, and
it's probably a good thing to actually _add_ --null.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help