<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion, branch v2.46.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.46.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.46.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-05-17T16:26:19Z</updated>
<entry>
<title>completion: adapt git-config(1) to complete subcommands</title>
<updated>2024-05-17T16:26:19Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-05-17T06:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5dd5007f8936f8d37cf95119e83039bd9237a3c5'/>
<id>urn:sha1:5dd5007f8936f8d37cf95119e83039bd9237a3c5</id>
<content type='text'>
With fe3ccc7aab (Merge branch 'ps/config-subcommands', 2024-05-15),
git-config(1) has gained support for subcommands. These subcommands live
next to the old, action-based mode, so that both the old and new way
continue to work.

The manpage for this command has been updated to prominently show the
subcommands, and the action-based modes are marked as deprecated. Update
Bash completion scripts accordingly to advertise subcommands instead of
actions.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dk/zsh-git-repo-path-fix'</title>
<updated>2024-05-08T17:18:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-08T17:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97673bdea7918488b3ce0a4591221ecdef299975'/>
<id>urn:sha1:97673bdea7918488b3ce0a4591221ecdef299975</id>
<content type='text'>
Command line completion support for zsh (in contrib/) has been
updated to stop exposing internal state to end-user shell
interaction.

* dk/zsh-git-repo-path-fix:
  completion: zsh: stop leaking local cache variable
</content>
</entry>
<entry>
<title>Merge branch 'rh/complete-symbolic-ref'</title>
<updated>2024-05-08T17:18:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-08T17:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c34e4e747261bd32cd8d5a4fb844cf97aec5fb9'/>
<id>urn:sha1:2c34e4e747261bd32cd8d5a4fb844cf97aec5fb9</id>
<content type='text'>
Command line completion script (in contrib/) learned to complete
"git symbolic-ref" a bit better (you need to enable plumbing
commands to be completed with GIT_COMPLETION_SHOW_ALL_COMMANDS).

* rh/complete-symbolic-ref:
  completion: add docs on how to add subcommand completions
  completion: improve docs for using __git_complete
  completion: add 'symbolic-ref'
</content>
</entry>
<entry>
<title>completion: zsh: stop leaking local cache variable</title>
<updated>2024-04-30T22:24:56Z</updated>
<author>
<name>D. Ben Knoble</name>
<email>ben.knoble+github@gmail.com</email>
</author>
<published>2024-04-30T21:53:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c20acdf465ba211978108ca8507d41e62a016fd'/>
<id>urn:sha1:3c20acdf465ba211978108ca8507d41e62a016fd</id>
<content type='text'>
Completing commands like "git rebase" in one repository will leak the
local __git_repo_path into the shell's environment so that completing
commands after changing to a different repository will give the old
repository's references (or none at all).

The bug report on the mailing list [1] suggests one simple way to observe
this yourself:

Enter the following commands from some directory:
  mkdir a b b/c
  for d (a b); git -C $d init &amp;&amp; git -C $d commit --allow-empty -m init
  cd a
  git branch foo
  pushd ../b/c
  git branch bar

Now type these:
  git rebase &lt;TAB&gt;… # completion for bar available; C-c to abort
  declare -p __git_repo_path # outputs /path/to/b/.git
  popd
  git branch # outputs foo, main
  git rebase &lt;TAB&gt;… # completion candidates are bar, main!

Ideally, the last typed &lt;TAB&gt; should be yielding foo, main.

Commit beb6ee7163 (completion: extract repository discovery from
__gitdir(), 2017-02-03) anticipated this problem by marking
__git_repo_path as local in __git_main and __gitk_main for Bash
completion but did not give the same mark to _git for Zsh completion.
Thus make __git_repo_path local for Zsh completion, too.

[1]: https://lore.kernel.org/git/CALnO6CBv3+e2WL6n6Mh7ZZHCX2Ni8GpvM4a-bQYxNqjmgZdwdg@mail.gmail.com/

Signed-off-by: D. Ben Knoble &lt;ben.knoble+github@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: add docs on how to add subcommand completions</title>
<updated>2024-04-25T16:23:27Z</updated>
<author>
<name>Roland Hieber</name>
<email>rhi@pengutronix.de</email>
</author>
<published>2024-04-25T10:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b7c45e8c9f7e6b6a602b9ba0727073573da552f'/>
<id>urn:sha1:6b7c45e8c9f7e6b6a602b9ba0727073573da552f</id>
<content type='text'>
Signed-off-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: improve docs for using __git_complete</title>
<updated>2024-04-25T16:23:26Z</updated>
<author>
<name>Roland Hieber</name>
<email>rhi@pengutronix.de</email>
</author>
<published>2024-04-25T10:18:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d13a2950747214567f1685802da523d009c543d9'/>
<id>urn:sha1:d13a2950747214567f1685802da523d009c543d9</id>
<content type='text'>
It took me more than a few tries and a good lecture of __git_main to
understand that the two paragraphs really only refer to adding
completion functions for executables that are not called through git's
subcommand magic. Improve the docs and be more specific.

Signed-off-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: add 'symbolic-ref'</title>
<updated>2024-04-25T16:23:26Z</updated>
<author>
<name>Roland Hieber</name>
<email>rhi@pengutronix.de</email>
</author>
<published>2024-04-25T10:18:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb85fdf4a4445fd201133dfc8d1e43c7e2e68bf5'/>
<id>urn:sha1:cb85fdf4a4445fd201133dfc8d1e43c7e2e68bf5</id>
<content type='text'>
Even 'symbolic-ref' is only completed when
GIT_COMPLETION_SHOW_ALL_COMMANDS=1 is set, it currently defaults to
completing file names, which is not very helpful. Add a simple
completion function which completes options and refs.

Signed-off-by: Roland Hieber &lt;rhi@pengutronix.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
