<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/test-parse-options.c, branch v2.7.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.7.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.7.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2015-06-22T22:07:21Z</updated>
<entry>
<title>parse-options: move unsigned long option parsing out of pack-objects.c</title>
<updated>2015-06-22T22:07:21Z</updated>
<author>
<name>Charles Bailey</name>
<email>cbailey32@bloomberg.net</email>
</author>
<published>2015-06-21T18:25:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2a514ed8058e35841d3d7b05a898991b83e5eaf0'/>
<id>urn:sha1:2a514ed8058e35841d3d7b05a898991b83e5eaf0</id>
<content type='text'>
The unsigned long option parsing (including 'k'/'m'/'g' suffix
parsing) is more widely applicable.  Add support for OPT_MAGNITUDE
to parse-options.h and change pack-objects.c use this support.

The error behavior on parse errors follows that of OPT_INTEGER.  The
name of the option that failed to parse is reported with a brief
message describing the expect format for the option argument and
then the full usage message for the command invoked.

This differs from the previous behavior for OPT_ULONG used in
pack-objects for --max-pack-size and --window-memory which used to
display the value supplied in the error message and did not display
the full usage message.

Signed-off-by: Charles Bailey &lt;cbailey32@bloomberg.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test-parse-options: update to handle negative ints</title>
<updated>2015-06-22T22:04:23Z</updated>
<author>
<name>Charles Bailey</name>
<email>cbailey32@bloomberg.net</email>
</author>
<published>2015-06-21T18:25:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=81a48cc08033a453bcb884ec0838a8f064a6611e'/>
<id>urn:sha1:81a48cc08033a453bcb884ec0838a8f064a6611e</id>
<content type='text'>
Fix the printf specification to treat 'integer' as the signed type
that it is and add a test that checks that we parse negative option
arguments.

Signed-off-by: Charles Bailey &lt;cbailey32@bloomberg.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: remove unused OPT_SET_PTR</title>
<updated>2014-03-31T20:01:19Z</updated>
<author>
<name>Marat Radchenko</name>
<email>marat@slonopotamus.org</email>
</author>
<published>2014-03-30T11:08:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=20d1c6528c76242581e89c271679d35884d916dc'/>
<id>urn:sha1:20d1c6528c76242581e89c271679d35884d916dc</id>
<content type='text'>
OPT_SET_PTR was never used since its creation at db7244bd
(parse-options new features., 2007-11-07).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: add cast to correct pointer type to OPT_SET_PTR</title>
<updated>2014-03-31T18:55:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-30T02:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9ff8ff310b71ab79ffb0ecaa004dec65cec31a45'/>
<id>urn:sha1:9ff8ff310b71ab79ffb0ecaa004dec65cec31a45</id>
<content type='text'>
Do not force users of OPT_SET_PTR to cast pointer to correct
underlying pointer type by integrating cast into OPT_SET_PTR macro.

Cast is required to prevent 'initialization makes integer from pointer
without a cast' compiler warning.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>MSVC: fix t0040-parse-options crash</title>
<updated>2014-03-31T18:54:27Z</updated>
<author>
<name>Marat Radchenko</name>
<email>marat@slonopotamus.org</email>
</author>
<published>2014-03-30T11:08:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e25c070cb5c85ac3abe787373563a31c8893a669'/>
<id>urn:sha1:e25c070cb5c85ac3abe787373563a31c8893a669</id>
<content type='text'>
On 64-bit MSVC, pointers are 64 bit but `long` is only 32.
Thus, casting string to `unsigned long`, which is redundand on other
platforms, throws away important bits and when later cast to `intptr_t`
results in corrupt pointer.

This patch fixes test-parse-options by replacing harming cast with
correct one.

Signed-off-by: Marat Radchenko &lt;marat@slonopotamus.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sparse: Fix mingw_main() argument number/type errors</title>
<updated>2013-04-28T19:32:08Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2013-04-27T19:19:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=84d32bf7678259c08406571cd6ce4b7a6724dcba'/>
<id>urn:sha1:84d32bf7678259c08406571cd6ce4b7a6724dcba</id>
<content type='text'>
Sparse issues 68 errors (two errors for each main() function) such
as the following:

      SP git.c
  git.c:510:5: error: too many arguments for function mingw_main
  git.c:510:5: error: symbol 'mingw_main' redeclared with different type \
    (originally declared at git.c:510) - different argument counts

The errors are caused by the 'main' macro used by the MinGW build
to provide a replacement main() function. The original main function
is effectively renamed to 'mingw_main' and is called from the new
main function. The replacement main is used to execute certain actions
common to all git programs on MinGW (e.g. ensure the standard I/O
streams are in binary mode).

In order to suppress the errors, we change the macro to include the
parameters in the declaration of the mingw_main function.

Unfortunately, this change provokes both sparse and gcc to complain
about 9 calls to mingw_main(), such as the following:

      CC git.o
  git.c: In function 'main':
  git.c:510: warning: passing argument 2 of 'mingw_main' from \
    incompatible pointer type
  git.c:510: note: expected 'const char **' but argument is of \
    type 'char **'

In order to suppress these warnings, since both of the main
functions need to be declared with the same prototype, we
change the declaration of the 9 main functions, thus:

    int main(int argc, char **argv)

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>test-parse-options: convert to OPT_BOOL()</title>
<updated>2012-02-26T23:18:41Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2012-02-25T19:11:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b9e63ddddc8928f39db6658bf6428a9b646e5ea5'/>
<id>urn:sha1:b9e63ddddc8928f39db6658bf6428a9b646e5ea5</id>
<content type='text'>
Introduce OPT_BOOL() to test-parse-options and add some tests for
these "true" boolean options. Rename OPT_BOOLEAN to OPT_COUNTUP and
OPTION_BOOLEAN to OPTION_COUNTUP as well.

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>
<entry>
<title>parseopt: add OPT_NOOP_NOARG</title>
<updated>2011-09-28T19:46:21Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2011-09-28T17:44:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6acec0380bfcd5e3f91c9100bf4d415db8f7acfd'/>
<id>urn:sha1:6acec0380bfcd5e3f91c9100bf4d415db8f7acfd</id>
<content type='text'>
Add OPT_NOOP_NOARG, a helper macro to define deprecated options in a
standard way.  The help text is taken from the no-op option -r of
git revert.

The callback could be made to emit a (conditional?) warning later.  And
we could also add OPT_NOOP (requiring an argument) etc. as needed.

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>
<entry>
<title>parse-options: add OPT_STRING_LIST helper</title>
<updated>2011-06-22T18:25:20Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-06-09T15:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c8ba163916554e9ffd3ce8cb2beeff003d90c0c3'/>
<id>urn:sha1:c8ba163916554e9ffd3ce8cb2beeff003d90c0c3</id>
<content type='text'>
This just adds repeated invocations of an option to a list
of strings. Using the "--no-&lt;var&gt;" form will reset the list
to empty.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make &lt;identifier&gt; lowercase as per CodingGuidelines</title>
<updated>2011-02-15T19:53:11Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2011-02-15T13:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=41dbcd45409b2986c011e67dd9e2b4d3072fc88d'/>
<id>urn:sha1:41dbcd45409b2986c011e67dd9e2b4d3072fc88d</id>
<content type='text'>
*.c part for matches with '&lt;[A-Z]+&gt;' (and affected test).

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
