<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/parse-options.c, branch v1.6.4.5</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.4.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.4.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2009-06-21T04:52:55Z</updated>
<entry>
<title>Fix various sparse warnings in the git source code</title>
<updated>2009-06-21T04:52:55Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-18T17:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2af202be3d2f128c6974290cabe13179c6462196'/>
<id>urn:sha1:2af202be3d2f128c6974290cabe13179c6462196</id>
<content type='text'>
There are a few remaining ones, but this fixes the trivial ones. It boils
down to two main issues that sparse complains about:

 - warning: Using plain integer as NULL pointer

   Sparse doesn't like you using '0' instead of 'NULL'. For various good
   reasons, not the least of which is just the visual confusion. A NULL
   pointer is not an integer, and that whole "0 works as NULL" is a
   historical accident and not very pretty.

   A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
   I didn't touch those.

 - warning: symbol 'xyz' was not declared. Should it be static?

   Sparse wants to see declarations for any functions you export. A lack
   of a declaration tends to mean that you should either add one, or you
   should mark the function 'static' to show that it's in file scope.

   A few of these remain: I only did the ones that should obviously just
   be made static.

That 'wt_status_submodule_summary' one is debatable. It has a few related
flags (like 'wt_status_use_color') which _are_ declared, and are used by
builtin-commit.c. So maybe we'd like to export it at some point, but it's
not declared now, and not used outside of that file, so 'static' it is in
this patch.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/parse-options-integer'</title>
<updated>2009-06-18T17:36:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-06-18T17:36:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d978ead4c3933425f54142f2c3fab7f5071e36ef'/>
<id>urn:sha1:d978ead4c3933425f54142f2c3fab7f5071e36ef</id>
<content type='text'>
* sb/parse-options-integer:
  parse-options: simplify usage argh handling
  parse-options: make OPT_INTEGER's argh explicit
</content>
</entry>
<entry>
<title>parse-options: add parse_options_check to validate option specs.</title>
<updated>2009-06-10T15:41:03Z</updated>
<author>
<name>Pierre Habouzit</name>
<email>madcoder@debian.org</email>
</author>
<published>2009-06-09T08:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=cb9d398c3506a6354a1c63d265a4228fcec28fda'/>
<id>urn:sha1:cb9d398c3506a6354a1c63d265a4228fcec28fda</id>
<content type='text'>
It only searches for now for the dreaded LASTARG_DEFAULT | OPTARG
combination, but can be extended to check for any other forbidden
combination.

Options are checked each time we call parse_options_start.

Signed-off-by: Pierre Habouzit &lt;madcoder@debian.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: simplify usage argh handling</title>
<updated>2009-06-06T20:25:34Z</updated>
<author>
<name>Stephen Boyd</name>
<email>bebarino@gmail.com</email>
</author>
<published>2009-06-04T23:43:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=34aec9f573af8e6fbe06285d660d9e1a84950e4c'/>
<id>urn:sha1:34aec9f573af8e6fbe06285d660d9e1a84950e4c</id>
<content type='text'>
Simplify the argh printing by simply calling usage_argh() if the option
can take an argument. Update macros defined in parse-options.h to set
the PARSE_OPT_NOARG flag.

The only other user of custom non-argument taking options is git-apply
(in this case OPTION_BOOLEAN for deprecated options). Update it to set
the PARSE_OPT_NOARG flag.

Thanks to Ren辿 Scharfe for the suggestion and starter patch.

Signed-off-by: Stephen Boyd &lt;bebarino@gmail.com&gt;
Reviewd-by: René Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: make OPT_INTEGER's argh explicit</title>
<updated>2009-06-06T20:25:01Z</updated>
<author>
<name>Stephen Boyd</name>
<email>bebarino@gmail.com</email>
</author>
<published>2009-06-04T23:43:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e3a0ca878457ecc70d0065802fcb0c6875c6b671'/>
<id>urn:sha1:e3a0ca878457ecc70d0065802fcb0c6875c6b671</id>
<content type='text'>
OPTION_INTEGER hardcodes its argh member to be "n", but the decision is
hidden deep in usage_with_options_internal(). Make "n" the default argh
for the OPT_INTEGER macro while leaving it undecided for the OPTION_INTEGER
enum.

This makes it less surprising to users that argh is "n" when using the
OPT_INTEGER macro.

Signed-off-by: Stephen Boyd &lt;bebarino@gmail.com&gt;
Reviewed-by: René Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-opts: add OPT_FILENAME and transition builtins</title>
<updated>2009-05-25T08:07:33Z</updated>
<author>
<name>Stephen Boyd</name>
<email>bebarino@gmail.com</email>
</author>
<published>2009-05-23T18:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=df217ed6430efe444a09fffdafd39720ae3f9864'/>
<id>urn:sha1:df217ed6430efe444a09fffdafd39720ae3f9864</id>
<content type='text'>
Commit dbd0f5c (Files given on the command line are relative to $cwd,
2008-08-06) introduced parse_options_fix_filename() as a minimal fix.
OPT_FILENAME is intended to be a more robust fix for the same issue.
OPT_FILENAME and its associated enum OPTION_FILENAME are used to
represent filename options within the parse options API.

This option is similar to OPTION_STRING. If --no is prefixed to the
option the filename is unset. If no argument is given and the default
value is set, the filename is set to the default value. The difference
is that the filename is prefixed with the prefix passed to
parse_options() (or parse_options_start()).

Update git-apply, git-commit, git-fmt-merge-msg, and git-tag to use
OPT_FILENAME with their filename options. Also, rename
parse_options_fix_filename() to fix_filename() as it is no longer
extern.

Signed-off-by: Stephen Boyd &lt;bebarino@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-opts: prepare for OPT_FILENAME</title>
<updated>2009-05-25T08:07:25Z</updated>
<author>
<name>Stephen Boyd</name>
<email>bebarino@gmail.com</email>
</author>
<published>2009-05-23T18:53:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=377829201783b8a648e07af6ce7d747e0f45dc19'/>
<id>urn:sha1:377829201783b8a648e07af6ce7d747e0f45dc19</id>
<content type='text'>
To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
which passes the prefix to parse_options_start() which sets the prefix
member of parse_opts_ctx accordingly. If there isn't a prefix in the
calling context, passing NULL will suffice.

Signed-off-by: Stephen Boyd &lt;bebarino@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/show-branch-parse-options' into sb/opt-filename</title>
<updated>2009-05-25T07:59:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-05-25T07:59:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b064e2fc3d197c3c691fe89c43d1bf79f64fcdf7'/>
<id>urn:sha1:b064e2fc3d197c3c691fe89c43d1bf79f64fcdf7</id>
<content type='text'>
* sb/show-branch-parse-options:
  show-branch: migrate to parse-options API
  parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's

Conflicts:
	parse-options.h
</content>
</entry>
<entry>
<title>parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's</title>
<updated>2009-05-23T05:46:04Z</updated>
<author>
<name>Stephen Boyd</name>
<email>bebarino@gmail.com</email>
</author>
<published>2009-05-21T07:33:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=29f25d493c1021a53acf41e5763e732217dd75c3'/>
<id>urn:sha1:29f25d493c1021a53acf41e5763e732217dd75c3</id>
<content type='text'>
Usually, the argh element in struct option points at a placeholder value
(e.g. "val"), and is shown in the usage message as

    --option=&lt;val&gt;

by enclosing the string inside of angle brackets.

When the option is more complex (e.g. optional arguments separated by a
comma), you would want to produce a usage message that looks like

    --option=&lt;val1&gt;[,&lt;val2&gt;]

In such a case, the caller can pass a string to argh with placeholders
already enclosed in necessary angle brackets (e.g.  "&lt;val1&gt;[,&lt;val2&gt;]")
and set this flag.

Signed-off-by: Stephen Boyd &lt;bebarino@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parseopt: add PARSE_OPT_NODASH</title>
<updated>2009-05-09T07:29:50Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-05-07T19:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=51a9949eda7421a2dd9cb45b2110d6571ba09bbd'/>
<id>urn:sha1:51a9949eda7421a2dd9cb45b2110d6571ba09bbd</id>
<content type='text'>
Add support for options that don't start with a dash.  Initially, they
don't accept arguments and can only be short options, i.e. consist of a
single character.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
