<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/parse-options.h, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-04-10T07:28:20Z</updated>
<entry>
<title>Merge branch 'ps/contains-id-error-message'</title>
<updated>2018-04-10T07:28:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-04-10T07:28:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=62c0fd46a875050e904831a73ef4375ed26cfaf6'/>
<id>urn:sha1:62c0fd46a875050e904831a73ef4375ed26cfaf6</id>
<content type='text'>
"git tag --contains no-such-commit" gave a full list of options
after giving an error message.

* ps/contains-id-error-message:
  parse-options: do not show usage upon invalid option value
</content>
</entry>
<entry>
<title>parse-options: do not show usage upon invalid option value</title>
<updated>2018-03-22T19:10:08Z</updated>
<author>
<name>Paul-Sebastian Ungureanu</name>
<email>ungureanupaulsebastian@gmail.com</email>
</author>
<published>2018-03-22T18:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3bb0923f06c55ea44569f547cefa9e1a59069ff2'/>
<id>urn:sha1:3bb0923f06c55ea44569f547cefa9e1a59069ff2</id>
<content type='text'>
Usually, the usage should be shown only if the user does not know what
options are available. If the user specifies an invalid value, the user
is already aware of the available options. In this case, there is no
point in displaying the usage anymore.

This patch applies to "git tag --contains", "git branch --contains",
"git branch --points-at", "git for-each-ref --contains" and many more.

Signed-off-by: Paul-Sebastian Ungureanu &lt;ungureanupaulsebastian@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate</title>
<updated>2018-03-07T19:02:48Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-03-07T01:05:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b475e442e8ec64e77acd7cb8c9c9bb321a76e82d'/>
<id>urn:sha1:b475e442e8ec64e77acd7cb8c9c9bb321a76e82d</id>
<content type='text'>
There is not a strong reason to hide this option, and git-merge already
completes this one. Let's allow to complete this for all commands (and
let git-completion.bash do the suppressing if needed).

This makes --rerere-autoupdate completable for am, cherry-pick and
revert. rebase completion is fixed manually because it's a shell
script and does not benefit from --git-completion-helper.

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>remote: force completing --mirror= instead of --mirror</title>
<updated>2018-02-09T18:24:52Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-09T11:02:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ebc4a04e8437e704e40a1d35aea030dc03ec8e56'/>
<id>urn:sha1:ebc4a04e8437e704e40a1d35aea030dc03ec8e56</id>
<content type='text'>
"git remote --mirror" is a special case. Technically it is possible to
specify --mirror without any argument. But we will get a "dangerous,
deprecated!" warning in that case.

This new parse-opt flag allows --git-completion-helper to always
complete --mirror=, ignoring the dangerous use case.

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>completion: use __gitcomp_builtin in _git_am</title>
<updated>2018-02-09T18:24:50Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-09T11:01:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be3ce6b2505467d445c671feeb76e7ad1c40aee7'/>
<id>urn:sha1:be3ce6b2505467d445c671feeb76e7ad1c40aee7</id>
<content type='text'>
The new completable options are:

--directory
--exclude
--gpg-sign
--include
--keep-cr
--keep-non-patch
--message-id
--no-keep-cr
--patch-format
--quiet
--reject
--resolvemsg=

In-progress options like --continue will be part of --git-completion-helper
then filtered out by _git_am() unless the operation is in progress. This
helps keep marking of these operations in just one place.

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: let OPT__FORCE take optional flags argument</title>
<updated>2018-02-09T18:24:50Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-09T11:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1224781d6080b8b69a81526ee23b22a1587920ea'/>
<id>urn:sha1:1224781d6080b8b69a81526ee23b22a1587920ea</id>
<content type='text'>
--force option is most likely hidden from command line completion for
safety reasons. This is done by adding an extra flag
PARSE_OPT_NOCOMPLETE. Update OPT__FORCE() to accept additional
flags. Actual flag change comes later depending on individual
commands.

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: add OPT_xxx_F() variants</title>
<updated>2018-02-09T18:24:50Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-09T11:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2de37349d9484fc51f45fe5dc9da56096b360221'/>
<id>urn:sha1:2de37349d9484fc51f45fe5dc9da56096b360221</id>
<content type='text'>
These macros allow us to add extra parse-options flag, the main one in
my mind is PARSE_OPT_NOCOMPLETE to hide certain options from
--git-completion-helper.

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: support --git-completion-helper</title>
<updated>2018-02-09T18:24:49Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-02-09T11:01:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b9d7f4b4dbebea34ca8d02be8889884fc3fb90c7'/>
<id>urn:sha1:b9d7f4b4dbebea34ca8d02be8889884fc3fb90c7</id>
<content type='text'>
This option is designed to be used by git-completion.bash. For many
simple cases, what we do in there is usually

    __gitcomp "lots of completion options"

which has to be manually updated when a new user-visible option is
added. With support from parse-options, we can write

    __gitcomp "$(git command --git-completion-helper)"

and get that list directly from the parser for free. Dangerous/Unpopular
options could be hidden with the new "NOCOMPLETE" flag.

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>ref-filter: add --no-contains option to tag/branch/for-each-ref</title>
<updated>2017-03-24T19:15:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-03-24T18:40:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac3f5a346860b824e083c5d305757c3260565475'/>
<id>urn:sha1:ac3f5a346860b824e083c5d305757c3260565475</id>
<content type='text'>
Change the tag, branch &amp; for-each-ref commands to have a --no-contains
option in addition to their longstanding --contains options.

This allows for finding the last-good rollout tag given a known-bad
&lt;commit&gt;. Given a hypothetically bad commit cf5c7253e0, the git
version to revert to can be found with this hacky two-liner:

    (git tag -l 'v[0-9]*'; git tag -l --contains cf5c7253e0 'v[0-9]*') |
        sort | uniq -c | grep -E '^ *1 ' | awk '{print $2}' | tail -n 10

With this new --no-contains option the same can be achieved with:

    git tag -l --no-contains cf5c7253e0 'v[0-9]*' | sort | tail -n 10

As the filtering machinery is shared between the tag, branch &amp;
for-each-ref commands, implement this for those commands too. A
practical use for this with "branch" is e.g. finding branches which
were branched off between v2.8.0 and v2.10.0:

    git branch --contains v2.8.0 --no-contains v2.10.0

The "describe" command also has a --contains option, but its semantics
are unrelated to what tag/branch/for-each-ref use --contains for. A
--no-contains option for "describe" wouldn't make any sense, other
than being exactly equivalent to not supplying --contains at all,
which would be confusing at best.

Add a --without option to "tag" as an alias for --no-contains, for
consistency with --with and --contains.  The --with option is
undocumented, and possibly the only user of it is
Junio (&lt;xmqqefy71iej.fsf@gitster.mtv.corp.google.com&gt;). But it's
trivial to support, so let's do that.

The additions to the the test suite are inverse copies of the
corresponding --contains tests. With this change --no-contains for
tag, branch &amp; for-each-ref is just as well tested as the existing
--contains option.

In addition to those tests, add a test for "tag" which asserts that
--no-contains won't find tree/blob tags, which is slightly
unintuitive, but consistent with how --contains works &amp; is documented.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: add OPT_NONEG to the "contains" option</title>
<updated>2017-03-24T19:15:25Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-03-24T18:40:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eab98ee5ab84def96012f115a8e10571c6e24e4e'/>
<id>urn:sha1:eab98ee5ab84def96012f115a8e10571c6e24e4e</id>
<content type='text'>
Add the OPT_NONEG flag to the "contains" option and its hidden synonym
"with". Since this was added in commit 694a577519 ("git-branch
--contains=commit", 2007-11-07) giving --no-{contains,with} hasn't
been an error, but has emitted the help output since
filter.with_commit wouldn't get set.

Now git will emit "error: unknown option `no-{contains,with}'" at the
top of the help output.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
