git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* parse-options does not recognize "unspecified" behavior
@ 2016-03-16 19:51 Pranit Bauva
  2016-03-16 20:49 ` Jeff King
  0 siblings, 1 reply; 18+ messages in thread
From: Pranit Bauva @ 2016-03-16 19:51 UTC (permalink / raw)
  To: Git List

Hey!

I noticed that parse-options does not recognize the variable which is
set to -1 so as to denote the "unspecified" value.

I did the following changes in builtin/commit.c (in master branch not
the patch I am working on) :
 - static int verbose = -1
 - introduced a printf statement after parsing the options to print
the value of verbose.

When I ran `git commit` :
 I get the output that verbose is set to -1.

When I ran `git commit -v` :
I get the output that verbose is set to 0.

When I ran `git commit -v -v` :
I get the output that verbose is set to 1.

When I ran `git commit --no-verbose` :
I get the out that verbose is set to 0.

Then I set verbose = -2.
And the output was obtained in a similar format.
 -2 with `git commit`
 -1 with `git commit -v`
  0 with `git commit -v -v`
  0 with `git commit --no-verbose`
  1 with `git commit -v -v -v`

It seems that parse-options just increments the value without
considering the -1 flag to denote "unspecified value".

Is this a bug?

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-03-25 15:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-16 19:51 parse-options does not recognize "unspecified" behavior Pranit Bauva
2016-03-16 20:49 ` Jeff King
2016-03-16 21:06   ` Pranit Bauva
2016-03-16 21:23     ` Jeff King
2016-03-16 21:37       ` Eric Sunshine
2016-03-16 21:41         ` Pranit Bauva
2016-03-16 21:44         ` Jeff King
2016-03-16 21:53           ` Stefan Beller
2016-03-16 23:16             ` Jeff King
2016-03-16 23:33               ` Stefan Beller
2016-03-17  1:43                 ` Jeff King
2016-03-17  5:32                   ` Eric Sunshine
2016-03-17  5:40                     ` Jeff King
2016-03-19 11:25                   ` SZEDER Gábor
2016-03-19 16:55                     ` Pranit Bauva
2016-03-25 14:58                       ` SZEDER Gábor
2016-03-25 15:03                         ` Pranit Bauva
2016-03-16 21:37       ` Pranit Bauva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).