<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/parse-options-cb.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-05-30T17:50:44Z</updated>
<entry>
<title>Merge branch 'nd/diff-parseopt'</title>
<updated>2019-05-30T17:50:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-30T17:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20aa7c594fbc2e36476daae2f53d7c020306c62c'/>
<id>urn:sha1:20aa7c594fbc2e36476daae2f53d7c020306c62c</id>
<content type='text'>
A brown-paper-bag bugfix to a change already in 'master'.

* nd/diff-parseopt:
  parse-options: check empty value in OPT_INTEGER and OPT_ABBREV
  diff-parseopt: restore -U (no argument) behavior
  diff-parseopt: correct variable types that are used by parseopt
</content>
</entry>
<entry>
<title>parse-options: check empty value in OPT_INTEGER and OPT_ABBREV</title>
<updated>2019-05-29T18:04:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-05-29T09:11:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7e68a08780e91d7c2f830f33457041407172b96'/>
<id>urn:sha1:f7e68a08780e91d7c2f830f33457041407172b96</id>
<content type='text'>
When parsing the argument for OPT_INTEGER and OPT_ABBREV, we check if we
can parse the entire argument to a number with "if (*s)". There is one
missing check: if "arg" is empty to begin with, we fail to notice.

This could happen with long option by writing like

  git diff --inter-hunk-context= blah blah

Before 16ed6c97cc (diff-parseopt: convert --inter-hunk-context,
2019-03-24), --inter-hunk-context is handled by a custom parser
opt_arg() and does detect this correctly.

This restores the bahvior for --inter-hunk-context and make sure all
other integer options are handled the same (sane) way. For OPT_ABBREV
this is new behavior. But it makes it consistent with the rest.

PS. OPT_MAGNITUDE has similar code but git_parse_ulong() does detect
empty "arg". So it's good to go.

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>
<entry>
<title>Merge branch 'pw/rebase-i-internal'</title>
<updated>2019-05-13T14:50:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-13T14:50:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7ba06bc3d026cee54437db5cfddfffe7b4d7a187'/>
<id>urn:sha1:7ba06bc3d026cee54437db5cfddfffe7b4d7a187</id>
<content type='text'>
The internal implementation of "git rebase -i" has been updated to
avoid forking a separate "rebase--interactive" process.

* pw/rebase-i-internal:
  rebase -i: run without forking rebase--interactive
  rebase: use a common action enum
  rebase -i: use struct rebase_options in do_interactive_rebase()
  rebase -i: use struct rebase_options to parse args
  rebase -i: use struct object_id for squash_onto
  rebase -i: use struct commit when parsing options
  rebase -i: remove duplication
  rebase -i: combine rebase--interactive.c with rebase.c
  rebase: use OPT_RERERE_AUTOUPDATE()
  rebase: rename write_basic_state()
  rebase: don't translate trace strings
  sequencer: always discard index after checkout
</content>
</entry>
<entry>
<title>rebase -i: use struct object_id for squash_onto</title>
<updated>2019-04-19T08:32:10Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2019-04-17T14:30:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=338985317eb84007f0d08979e751cbf32a375a52'/>
<id>urn:sha1:338985317eb84007f0d08979e751cbf32a375a52</id>
<content type='text'>
More preparation for using `struct rebase_options` in
cmd_rebase__interactive(). Using a string was a hangover from the
scripted version of rebase, update the functions that use `squash_onto`
to take a `sturct object_id`.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rebase -i: use struct commit when parsing options</title>
<updated>2019-04-19T08:32:10Z</updated>
<author>
<name>Phillip Wood</name>
<email>phillip.wood@dunelm.org.uk</email>
</author>
<published>2019-04-17T14:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7d3488eb893ba53186770181171ee8ebc8100e18'/>
<id>urn:sha1:7d3488eb893ba53186770181171ee8ebc8100e18</id>
<content type='text'>
This is in preparation for using `struct rebase_options` when parsing
options in cmd_rebase__interactive(). Using a string for onto,
restrict_revision and upstream, was a hangover from the scripted version
of rebase. The functions that use these variables are updated to take a
`struct commit`.

Signed-off-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-parseopt: convert --[no-]abbrev</title>
<updated>2019-03-24T13:21:22Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-03-24T08:20:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d877418390168c9696fd46d5e78ca3362f26f74c'/>
<id>urn:sha1:d877418390168c9696fd46d5e78ca3362f26f74c</id>
<content type='text'>
OPT__ABBREV() has the same behavior as the deleted code with one
difference: it does check for valid number and error out if not. And the
'40' change is self explanatory.

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>
<entry>
<title>parse-options: allow ll_callback with OPTION_CALLBACK</title>
<updated>2019-01-28T00:28:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-27T00:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ebbe289896a698b99c91b797440563272dcd716'/>
<id>urn:sha1:3ebbe289896a698b99c91b797440563272dcd716</id>
<content type='text'>
OPTION_CALLBACK is much simpler/safer to use, but parse_opt_cb does
not allow access to parse_opt_ctx_t, which sometimes is useful
(e.g. to obtain the prefix).

Extending parse_opt_cb to take parse_opt_cb could result in a lot of
changes. Instead let's just allow ll_callback to be used with
OPTION_CALLBACK. The user will have to be careful, not to change
anything in ctx, or return wrong result code. But that's the price for
ll_callback.

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>
<entry>
<title>parse-options: avoid magic return codes</title>
<updated>2019-01-28T00:28:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-27T00:35:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f41179f16ba2fc16e31be81518536008afe2e278'/>
<id>urn:sha1:f41179f16ba2fc16e31be81518536008afe2e278</id>
<content type='text'>
Give names to these magic negative numbers. Make parse_opt_ll_cb
return an enum to make clear it can actually control parse_options()
with different return values (parse_opt_cb can too, but nobody needs
it).

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>
<entry>
<title>parse-options: stop abusing 'callback' for lowlevel callbacks</title>
<updated>2019-01-28T00:28:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-01-27T00:35:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf3ff338a25b7353ec6d39d31e14d081be9e3471'/>
<id>urn:sha1:bf3ff338a25b7353ec6d39d31e14d081be9e3471</id>
<content type='text'>
Lowlevel callbacks have different function signatures. Add a new field
in 'struct option' with the right type for lowlevel callbacks.

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>
<entry>
<title>Merge branch 'nd/i18n'</title>
<updated>2019-01-04T21:33:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-04T21:33:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3813a89faee3ecb111aa206f68b46618ec853e4e'/>
<id>urn:sha1:3813a89faee3ecb111aa206f68b46618ec853e4e</id>
<content type='text'>
More _("i18n") markings.

* nd/i18n:
  fsck: mark strings for translation
  fsck: reduce word legos to help i18n
  parse-options.c: mark more strings for translation
  parse-options.c: turn some die() to BUG()
  parse-options: replace opterror() with optname()
  repack: mark more strings for translation
  remote.c: mark messages for translation
  remote.c: turn some error() or die() to BUG()
  reflog: mark strings for translation
  read-cache.c: add missing colon separators
  read-cache.c: mark more strings for translation
  read-cache.c: turn die("internal error") to BUG()
  attr.c: mark more string for translation
  archive.c: mark more strings for translation
  alias.c: mark split_cmdline_strerror() strings for translation
  git.c: mark more strings for translation
</content>
</entry>
</feed>
