<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/parse-options.c, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-12-15T03:24:33Z</updated>
<entry>
<title>Merge branch 'nd/show-gitcomp-compilation-fix' into maint</title>
<updated>2018-12-15T03:24:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-12-15T03:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf29f074ed7019abb53398c4cd5659d9f939d9a8'/>
<id>urn:sha1:bf29f074ed7019abb53398c4cd5659d9f939d9a8</id>
<content type='text'>
Portability fix for a recent update to parse-options API.

* nd/show-gitcomp-compilation-fix:
  parse-options: fix SunCC compiler warning
</content>
</entry>
<entry>
<title>parse-options: fix SunCC compiler warning</title>
<updated>2018-12-12T08:21:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-12-11T15:35:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc'/>
<id>urn:sha1:a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc</id>
<content type='text'>
The compiler reports this because show_gitcomp() never actually
returns a value:

    "parse-options.c", line 520: warning: Function has no return
    statement : show_gitcomp

We could shut the compiler up. But instead let's not bury exit() too
deep. Do the same as internal -h handling, return a special error code
and handle the exit() in parse_options() (and other
parse_options_step() callers) instead.

Reported-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.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>
<entry>
<title>Merge branch 'rs/parse-opt-lithelp'</title>
<updated>2018-08-17T20:09:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-17T20:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8963bb0c2d023738f8ea021b512ed83cd79ee754'/>
<id>urn:sha1:8963bb0c2d023738f8ea021b512ed83cd79ee754</id>
<content type='text'>
The parse-options machinery learned to refrain from enclosing
placeholder string inside a "&lt;bra" and "ket&gt;" pair automatically
without PARSE_OPT_LITERAL_ARGHELP.  Existing help text for option
arguments that are not formatted correctly have been identified and
fixed.

* rs/parse-opt-lithelp:
  parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
  shortlog: correct option help for -w
  send-pack: specify --force-with-lease argument help explicitly
  pack-objects: specify --index-version argument help explicitly
  difftool: remove angular brackets from argument help
  add, update-index: fix --chmod argument help
  push: use PARSE_OPT_LITERAL_ARGHELP instead of unbalanced brackets
</content>
</entry>
<entry>
<title>parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP</title>
<updated>2018-08-03T15:36:20Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2018-08-02T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f0df44cd79a953c287ccb598896ea7aaa2cc9e3'/>
<id>urn:sha1:5f0df44cd79a953c287ccb598896ea7aaa2cc9e3</id>
<content type='text'>
Parseopt wraps argument help strings in a pair of angular brackets by
default, to tell users that they need to replace it with an actual
value.  This is useful in most cases, because most option arguments
are indeed single values of a certain type.  The option
PARSE_OPT_LITERAL_ARGHELP needs to be used in option definitions with
arguments that have multiple parts or are literal strings.

Stop adding these angular brackets if special characters are present,
as they indicate that we don't deal with a simple placeholder.  This
simplifies the code a bit and makes defining special options slightly
easier.

Remove the flag PARSE_OPT_LITERAL_ARGHELP in the cases where the new
and more cautious handling suffices.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: collapse extra --no-.. options</title>
<updated>2018-06-11T17:38:10Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-06-06T09:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b221b5ab9b92f3def37184db6e052ec87d7635b4'/>
<id>urn:sha1:b221b5ab9b92f3def37184db6e052ec87d7635b4</id>
<content type='text'>
The commands that make use of --git-completion-helper feature could
now produce a lot of --no-xxx options that a command can take. This in
many case could nearly double the amount of completable options, using
more screen estate and also harder to search for the wanted option.

This patch attempts to mitigate that by collapsing extra --no-
options, the ones that are added by --git-completion-helper and not in
original struct option arrays. The "--no-..." option will be displayed
in this case to hint about more options, e.g.

    &gt; ~/w/git $ git clone --
    --bare                 --origin=
    --branch=              --progress
    --checkout             --quiet
    --config=              --recurse-submodules
    --depth=               --reference=
    --dissociate           --reference-if-able=
    --filter=              --separate-git-dir=
    --hardlinks            --shallow-exclude=
    --ipv4                 --shallow-since=
    --ipv6                 --shallow-submodules
    --jobs=                --shared
    --local                --single-branch
    --mirror               --tags
    --no-...               --template=
    --no-checkout          --upload-pack=
    --no-hardlinks         --verbose
    --no-tags

and when you complete it with --no-&lt;tab&gt;, all negative options will be
presented:

    &gt; ~/w/git $ git clone --no-
    --no-bare                 --no-quiet
    --no-branch               --no-recurse-submodules
    --no-checkout             --no-reference
    --no-config               --no-reference-if-able
    --no-depth                --no-separate-git-dir
    --no-dissociate           --no-shallow-exclude
    --no-filter               --no-shallow-since
    --no-hardlinks            --no-shallow-submodules
    --no-ipv4                 --no-shared
    --no-ipv6                 --no-single-branch
    --no-jobs                 --no-tags
    --no-local                --no-template
    --no-mirror               --no-upload-pack
    --no-origin               --no-verbose
    --no-progress

Corner case: to make sure that people will never accidentally complete
the fake option "--no-..." there must be one real --no- in the first
complete listing even if it's not from the original struct option.

PS. This could could be made simpler with ";&amp;" to fall through from
"--no-*" block and share the code but ";&amp;" is not available on bash-3
(i.e. Mac)

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: option to let --git-completion-helper show negative form</title>
<updated>2018-05-29T04:28:44Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-05-27T08:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b1c01d22ef280ef3a6efd70db2b9aa58359ee36'/>
<id>urn:sha1:2b1c01d22ef280ef3a6efd70db2b9aa58359ee36</id>
<content type='text'>
When 7fb6aefd2a (Merge branch 'nd/parseopt-completion' - 2018-03-14)
is merged, the completion for negative form is left out because the
series is alread long and it could be done in a follow up series. This
is it.

--git-completion-helper now provides --no-xxx so that git-completion.bash
can drop the extra custom --no-xxx in the script. It adds a lot more
--no-xxx than what's current provided by the git-completion.bash
script. We'll trim that down later.

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 '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>Merge branch 'nd/parseopt-completion'</title>
<updated>2018-03-14T19:01:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-14T19:01:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fb6aefd2aaffe66e614f7f7b83e5b7ab16d4806'/>
<id>urn:sha1:7fb6aefd2aaffe66e614f7f7b83e5b7ab16d4806</id>
<content type='text'>
Teach parse-options API an option to help the completion script,
and make use of the mechanism in command line completion.

* nd/parseopt-completion: (45 commits)
  completion: more subcommands in _git_notes()
  completion: complete --{reuse,reedit}-message= for all notes subcmds
  completion: simplify _git_notes
  completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate
  completion: use __gitcomp_builtin in _git_worktree
  completion: use __gitcomp_builtin in _git_tag
  completion: use __gitcomp_builtin in _git_status
  completion: use __gitcomp_builtin in _git_show_branch
  completion: use __gitcomp_builtin in _git_rm
  completion: use __gitcomp_builtin in _git_revert
  completion: use __gitcomp_builtin in _git_reset
  completion: use __gitcomp_builtin in _git_replace
  remote: force completing --mirror= instead of --mirror
  completion: use __gitcomp_builtin in _git_remote
  completion: use __gitcomp_builtin in _git_push
  completion: use __gitcomp_builtin in _git_pull
  completion: use __gitcomp_builtin in _git_notes
  completion: use __gitcomp_builtin in _git_name_rev
  completion: use __gitcomp_builtin in _git_mv
  completion: use __gitcomp_builtin in _git_merge_base
  ...
</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>
</feed>
