<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion/git-completion.bash, 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-03-14T21:05:25Z</updated>
<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>
<entry>
<title>completion: fix __git_complete_worktree_paths</title>
<updated>2024-02-27T21:37:24Z</updated>
<author>
<name>Rubén Justo</name>
<email>rjusto@gmail.com</email>
</author>
<published>2024-02-27T21:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3574816d98a332187fc331826cdf170b0adf3a47'/>
<id>urn:sha1:3574816d98a332187fc331826cdf170b0adf3a47</id>
<content type='text'>
Use __git to invoke "worktree list" in __git_complete_worktree_paths, to
respect any "-C" and "--git-dir" options present on the command line.

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: use awk for filtering the config entries</title>
<updated>2024-02-16T20:14:11Z</updated>
<author>
<name>Beat Bolli</name>
<email>dev+git@drbeat.li</email>
</author>
<published>2024-02-16T17:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c2e3d42d117197ead05264d47fb6eea0a3834c3'/>
<id>urn:sha1:3c2e3d42d117197ead05264d47fb6eea0a3834c3</id>
<content type='text'>
Commits 1e0ee4087e (completion: add and use
__git_compute_first_level_config_vars_for_section, 2024-02-10) and
6e32f718ff (completion: add and use
__git_compute_second_level_config_vars_for_section, 2024-02-10)
introduced new helpers for config completion.

Both helpers use a pipeline of grep and awk to filter the list of config
entries. awk is perfectly capable of filtering, so let's eliminate the
grep process and move the filtering into the awk script.

The "-E" grep option (extended syntax) was not necessary, as $section is
a single word.

While at it, wrap the over-long lines to make them more readable.

Signed-off-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pb/complete-config'</title>
<updated>2024-02-14T23:36:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-02-14T23:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89400c361510c58bbbeac7d98967627636069340'/>
<id>urn:sha1:89400c361510c58bbbeac7d98967627636069340</id>
<content type='text'>
The command line completion script (in contrib/) learned to
complete configuration variable names better.

* pb/complete-config:
  completion: add and use __git_compute_second_level_config_vars_for_section
  completion: add and use __git_compute_first_level_config_vars_for_section
  completion: complete 'submodule.*' config variables
  completion: add space after config variable names also in Bash 3
</content>
</entry>
</feed>
