<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4013/diff.diff_-U1_initial..side, branch v2.22.0</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.22.0</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.22.0'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2019-05-29T18:04:32Z</updated>
<entry>
<title>diff-parseopt: restore -U (no argument) behavior</title>
<updated>2019-05-29T18:04:32Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-05-29T09:11:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=8ef05193bcdda6a28cd41fa3ecd8f356061d49e0'/>
<id>urn:sha1:8ef05193bcdda6a28cd41fa3ecd8f356061d49e0</id>
<content type='text'>
Before d473e2e0e8 (diff.c: convert -U|--unified, 2019-01-27), -U and
--unified are implemented with a custom parser opt_arg() in diff.c. I
didn't check this code carefully and not realize that it's the
equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.

In other words, if -U is specified without any argument, the option
should be accepted, and the default value should be used. Without
PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
regression.

Reported-by: Bryan Turner &lt;bturner@atlassian.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
