<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion, branch v2.45.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-04-10T17:00:08Z</updated>
<entry>
<title>Merge branch 'vs/complete-with-set-u-fix'</title>
<updated>2024-04-10T17:00:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-10T17:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4a1453ad173c61663dceed2452d21616ee46b44'/>
<id>urn:sha1:a4a1453ad173c61663dceed2452d21616ee46b44</id>
<content type='text'>
Another "set -u" fix for the bash prompt (in contrib/) script.

* vs/complete-with-set-u-fix:
  completion: protect prompt against unset SHOWUPSTREAM in nounset mode
  completion: fix prompt with unset SHOWCONFLICTSTATE in nounset mode
</content>
</entry>
<entry>
<title>completion: protect prompt against unset SHOWUPSTREAM in nounset mode</title>
<updated>2024-04-01T19:38:23Z</updated>
<author>
<name>Ville Skyttä</name>
<email>ville.skytta@iki.fi</email>
</author>
<published>2024-04-01T19:07:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7805bc74351e61126e587a7470e3fbf843caf8a'/>
<id>urn:sha1:d7805bc74351e61126e587a7470e3fbf843caf8a</id>
<content type='text'>
As it stands, the only call site of `__git_ps1_show_upstream` checks
that the `GIT_PS1_SHOWUPSTREAM` variable is set, so this is effectively
a no-op. However, that might change, and chances of noticing the
unprotected use might not be that high when it does.

Signed-off-by: Ville Skyttä &lt;ville.skytta@iki.fi&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: fix prompt with unset SHOWCONFLICTSTATE in nounset mode</title>
<updated>2024-04-01T15:31:54Z</updated>
<author>
<name>Ville Skyttä</name>
<email>ville.skytta@iki.fi</email>
</author>
<published>2024-04-01T11:30:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=758b4e137349b8548ada07346ab82e82079b43a3'/>
<id>urn:sha1:758b4e137349b8548ada07346ab82e82079b43a3</id>
<content type='text'>
`GIT_PS1_SHOWCONFLICTSTATE` is a user variable that might not be set,
causing errors when the shell is in `nounset` mode.

Take into account on access by falling back to an empty string.

Signed-off-by: Ville Skyttä &lt;ville.skytta@iki.fi&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rj/complete-worktree-paths-fix'</title>
<updated>2024-03-14T21:05:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-14T21:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5a7ee124d491d5fe0e3948532ca8219b3b471c0'/>
<id>urn:sha1:c5a7ee124d491d5fe0e3948532ca8219b3b471c0</id>
<content type='text'>
The logic to complete the command line arguments to "git worktree"
subcommand (in contrib/) has been updated to correctly honor things
like "git -C dir" etc.

* rj/complete-worktree-paths-fix:
  completion: fix __git_complete_worktree_paths
</content>
</entry>
<entry>
<title>Merge branch 'rj/complete-reflog'</title>
<updated>2024-03-14T21:05:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-14T21:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43100746e69aacb3f8110a9855aacd66483f7e24'/>
<id>urn:sha1:43100746e69aacb3f8110a9855aacd66483f7e24</id>
<content type='text'>
The command line completion script (in contrib/) learned to
complete "git reflog" better.

* rj/complete-reflog:
  completion: reflog subcommands and options
  completion: factor out __git_resolve_builtins
  completion: introduce __git_find_subcommand
  completion: reflog show &lt;log-options&gt;
  completion: reflog with implicit "show"
</content>
</entry>
<entry>
<title>completion: reflog subcommands and options</title>
<updated>2024-03-03T22:21:39Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-03-02T15:52:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1284f9cc11be4b656492938f68befbe4c87d915f'/>
<id>urn:sha1:1284f9cc11be4b656492938f68befbe4c87d915f</id>
<content type='text'>
Make generic the completion for reflog subcommands and its options.

Note that we still need to special case the options for "show".

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: factor out __git_resolve_builtins</title>
<updated>2024-03-03T22:21:39Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-03-02T15:52:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=476a236e72d7ad0d2a5237faeaa439b1054e80a5'/>
<id>urn:sha1:476a236e72d7ad0d2a5237faeaa439b1054e80a5</id>
<content type='text'>
We're going to use the result of "git xxx --git-completion-helper" not
only for feeding COMPREPLY.

Therefore, factor out the execution and the caching of its results in
__gitcomp_builtin, to a new function __git_resolve_builtins.

While we're here, move an important comment we have in the function to
its header, so it gains visibility.

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: introduce __git_find_subcommand</title>
<updated>2024-03-03T22:21:38Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-03-02T15:51:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3fec482b5f7f2f13c7465cf79062440a84233d14'/>
<id>urn:sha1:3fec482b5f7f2f13c7465cf79062440a84233d14</id>
<content type='text'>
Let's have a function to get the current subcommand when completing
commands that follow the syntax:

    git &lt;command&gt; &lt;subcommand&gt;

As a convenience, let's allow an optional "default subcommand" to be
returned if none is found.

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: reflog show &lt;log-options&gt;</title>
<updated>2024-03-03T22:21:38Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-03-02T15:50:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c689c38bc2dceac3f8fe975472f12c0dbe473537'/>
<id>urn:sha1:c689c38bc2dceac3f8fe975472f12c0dbe473537</id>
<content type='text'>
Let's add completion for &lt;log-options&gt; in "reflog show" so that the user
can easily discover uses like:

   $ git reflog --since=1.day.ago

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: reflog with implicit "show"</title>
<updated>2024-03-03T22:21:38Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-03-02T14:37:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=85452a1d4b582701772b02b5a70b8bf5a82258bc'/>
<id>urn:sha1:85452a1d4b582701772b02b5a70b8bf5a82258bc</id>
<content type='text'>
When no subcommand is specified to "reflog", we assume "show" [1]:

    $ git reflog -h
    usage: git reflog [show] [&lt;log-options&gt;] [&lt;ref&gt;]
    ...

This implicit "show" is not being completed correctly:

    $ git checkout -b default
    $ git reflog def&lt;TAB&gt;&lt;TAB&gt;
    ... no completion options ...

The expected result is:

    $ git reflog default

This happens because we're completing references after seeing a valid
subcommand in the command line.  This prevents the implicit "show" from
working properly, but also introduces a new problem: it keeps offering
subcommand options when the subcommand is implicit:

    $ git checkout -b explore
    $ git reflog default ex&lt;TAB&gt;
    ...
    $ git reflog default expire

The expected result is:

    $ git reflog default explore

To fix this, complete references even if no subcommand is present, or in
other words when the subcommand is implicit "show".

Also, only include completion options for subcommands when completing
the right position in the command line.

  1. cf39f54efc (git reflog show, 2007-02-08)

Signed-off-by: Rubén Justo &lt;rjusto@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
