<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion, branch v2.43.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.43.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.43.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-12-19T23:11:58Z</updated>
<entry>
<title>completion: support pseudoref existence checks for reftables</title>
<updated>2023-12-19T23:11:58Z</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2023-12-19T22:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44dbb3bf29a7e27ee2f52b5ab86347618c879811'/>
<id>urn:sha1:44dbb3bf29a7e27ee2f52b5ab86347618c879811</id>
<content type='text'>
In contrib/completion/git-completion.bash, there are a bunch of
instances where we read pseudorefs, such as HEAD, MERGE_HEAD,
REVERT_HEAD, and others via the filesystem. However, the upcoming
reftable refs backend won't use '.git/HEAD' at all but instead will
write an invalid refname as placeholder for backwards compatibility,
which will break the git-completion script.

Update the '__git_pseudoref_exists' function to:

1. Recognize the placeholder '.git/HEAD' written by the reftable
   backend (its content is specified in the reftable specs).
2. If reftable is in use, use 'git rev-parse' to determine whether the
    given ref exists.
3. Otherwise, continue to use 'test -f' to check for the ref's filename.

Signed-off-by: Stan Hu &lt;stanhu@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: refactor existence checks for pseudorefs</title>
<updated>2023-12-19T23:11:56Z</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2023-12-19T22:14:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=666270a2df49132c683f53b5efde240dd9bf5c5e'/>
<id>urn:sha1:666270a2df49132c683f53b5efde240dd9bf5c5e</id>
<content type='text'>
In preparation for the reftable backend, this commit introduces a
'__git_pseudoref_exists' function that continues to use 'test -f' to
determine whether a given pseudoref exists in the local filesystem.

Signed-off-by: Stan Hu &lt;stanhu@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: complete '--dd'</title>
<updated>2023-10-09T19:47:29Z</updated>
<author>
<name>Sergey Organov</name>
<email>sorganov@gmail.com</email>
</author>
<published>2023-10-09T16:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7c446ac7903555356d66e24dca5e370f0e1158bc'/>
<id>urn:sha1:7c446ac7903555356d66e24dca5e370f0e1158bc</id>
<content type='text'>
'--dd' only makes sense for 'git log' and 'git show', so add it to
__git_log_show_options which is referenced in the completion for these
two commands.

Signed-off-by: Sergey Organov &lt;sorganov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: loosen and document the requirement around completing alias</title>
<updated>2023-09-20T18:41:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-09-20T18:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d73a2cc036199a25cc97586937267ec14cb6eae'/>
<id>urn:sha1:8d73a2cc036199a25cc97586937267ec14cb6eae</id>
<content type='text'>
Recently we started to tell users to spell ": git foo ;" with
space(s) around 'foo' for an alias to be completed similarly
to the 'git foo' command.  It however is easy to also allow users to
spell it in a more natural way with the semicolon attached to 'foo',
i.e. ": git foo;".  Also, add a comment to note that 'git' is optional
and writing ": foo;" would complete the alias just fine.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pb/completion-aliases-doc'</title>
<updated>2023-09-20T17:44:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-09-20T17:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c71f082eb2336909b4a291d014c98dbdde18a92'/>
<id>urn:sha1:8c71f082eb2336909b4a291d014c98dbdde18a92</id>
<content type='text'>
Clarify how "alias.foo = : git cmd ; aliased-command-string" should
be spelled with necessary whitespaces around punctuation marks to
work.

* pb/completion-aliases-doc:
  completion: improve doc for complex aliases
</content>
</entry>
<entry>
<title>Merge branch 'pb/complete-commit-trailers'</title>
<updated>2023-09-20T17:44:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-09-20T17:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e9dac4b86c2c06f834eedad88302b76d2981c039'/>
<id>urn:sha1:e9dac4b86c2c06f834eedad88302b76d2981c039</id>
<content type='text'>
The command-line complation support (in contrib/) learned to
complete "git commit --trailer=" for possible trailer keys.

* pb/complete-commit-trailers:
  completion: commit: complete trailers tokens more robustly
  completion: commit: complete configured trailer tokens
</content>
</entry>
<entry>
<title>Merge branch 'js/complete-checkout-t'</title>
<updated>2023-09-18T20:53:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-09-18T20:53:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f41c5a5eec6a8fcc2ed683541d50e4bfe0a066ba'/>
<id>urn:sha1:f41c5a5eec6a8fcc2ed683541d50e4bfe0a066ba</id>
<content type='text'>
The completion script (in contrib/) has been taught to treat the
"-t" option to "git checkout" and "git switch" just like the
"--track" option, to complete remote-tracking branches.

* js/complete-checkout-t:
  completion(switch/checkout): treat --track and -t the same
</content>
</entry>
<entry>
<title>completion: improve doc for complex aliases</title>
<updated>2023-09-13T00:46:01Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2023-09-12T17:02:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4333267995662ccc9f4db3b628eebb78599e0025'/>
<id>urn:sha1:4333267995662ccc9f4db3b628eebb78599e0025</id>
<content type='text'>
The completion code can be told to use a particular completion for
aliases that shell out by using ': git &lt;cmd&gt; ;' as the first command of
the alias. This only works if &lt;cmd&gt; and the semicolon are separated by a
space, since if the space is missing __git_aliased_command returns (for
example) 'checkout;' instead of just 'checkout', and then
__git_complete_command fails to find a completion for 'checkout;'.

The examples have that space but it's not clear if it's just for
style or if it's mandatory. Explicitly mention it.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: commit: complete trailers tokens more robustly</title>
<updated>2023-09-13T00:33:59Z</updated>
<author>
<name>Philippe Blain</name>
<email>levraiphilippeblain@gmail.com</email>
</author>
<published>2023-09-12T17:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b658eae751968506552f1bddadc338653819d20'/>
<id>urn:sha1:0b658eae751968506552f1bddadc338653819d20</id>
<content type='text'>
In the previous commit, we added support for completing configured
trailer tokens in 'git commit --trailer'.

Make the implementation more robust by:

- using '__git' instead of plain 'git', as the rest of the completion
  script does
- using a stricter pattern for --get-regexp to avoid false hits
- using 'cut' and 'rev' instead of 'awk' to account for tokens including
  dots.

Signed-off-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion(switch/checkout): treat --track and -t the same</title>
<updated>2023-09-08T16:26:15Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-09-08T12:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f892830d6965d68bfa937cebcfbed9c9e552700'/>
<id>urn:sha1:9f892830d6965d68bfa937cebcfbed9c9e552700</id>
<content type='text'>
When `git switch --track ` is to be completed, only remote refs are
eligible because that is what the `--track` option targets.

And when the short-hand `-t` is used instead, the same _should_ happen.
Let's make it so.

Note that the bug exists both in the completions of `switch` and
`completion`, even if it manifests in slightly different ways: While
the completion of `git switch -t ` will not even look at remote refs,
the completion of `git checkout -t ` will look at both remote _and_
local refs. Both should look only at remote refs.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
