<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion/git-completion.bash, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-10-29T22:43:16Z</updated>
<entry>
<title>Merge branch 're/completion-fix-test-equality'</title>
<updated>2021-10-29T22:43:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-29T22:43:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a95a9f230c30b44990e616dff154ab78f0aa60d'/>
<id>urn:sha1:9a95a9f230c30b44990e616dff154ab78f0aa60d</id>
<content type='text'>
Fix long-standing shell syntax error in the completion script.

* re/completion-fix-test-equality:
  completion: fix incorrect bash/zsh string equality check
</content>
</entry>
<entry>
<title>completion: fix incorrect bash/zsh string equality check</title>
<updated>2021-10-28T16:33:19Z</updated>
<author>
<name>Robert Estelle</name>
<email>robertestelle@gmail.com</email>
</author>
<published>2021-10-25T22:29:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=46b05852863a532a897f09a8461586f3d2d38693'/>
<id>urn:sha1:46b05852863a532a897f09a8461586f3d2d38693</id>
<content type='text'>
In the basic `[`/`test` command, the string equality operator is a
single `=`. The `==` operator is only available in `[[`, which is a
bash-ism also supported by zsh.

This mix-up was causing the following completion error in zsh:
&gt; __git_ls_files_helper:7: = not found

(That message refers to the extraneous symbol in `==` ← `=`).

This updates that comparison to use a single `=` inside the
basic `[ … ]` test conditional.

Although this fix is inconsistent with the other comparisons in this
file, which use `[[ … == … ]]`, and the two expressions are functionally
identical in this context, that approach was rejected due to a
preference for `[`.

Signed-off-by: Robert Estelle &lt;robertestelle@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/retire-preserve-merges'</title>
<updated>2021-10-18T22:47:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-18T22:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=223a1bfb5821387981c700654e4edd2443c5a7fc'/>
<id>urn:sha1:223a1bfb5821387981c700654e4edd2443c5a7fc</id>
<content type='text'>
The "--preserve-merges" option of "git rebase" has been removed.

* js/retire-preserve-merges:
  sequencer: restrict scope of a formerly public function
  rebase: remove a no-longer-used function
  rebase: stop mentioning the -p option in comments
  rebase: remove obsolete code comment
  rebase: drop the internal `rebase--interactive` command
  git-svn: drop support for `--preserve-merges`
  rebase: drop support for `--preserve-merges`
  pull: remove support for `--rebase=preserve`
  tests: stop testing `git rebase --preserve-merges`
  remote: warn about unhandled branch.&lt;name&gt;.rebase values
  t5520: do not use `pull.rebase=preserve`
</content>
</entry>
<entry>
<title>Merge branch 'fc/completion-updates' into maint</title>
<updated>2021-10-12T20:51:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-12T20:51:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5d1c7028d06670fb8b3e851aa19316a7e2d2a64'/>
<id>urn:sha1:c5d1c7028d06670fb8b3e851aa19316a7e2d2a64</id>
<content type='text'>
Command line completion updates.

* fc/completion-updates:
  completion: bash: add correct suffix in variables
  completion: bash: fix for multiple dash commands
  completion: bash: fix for suboptions with value
  completion: bash: fix prefix detection in branch.*
</content>
</entry>
<entry>
<title>help / completion: make "git help" do the hard work</title>
<updated>2021-09-23T17:30:43Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-21T22:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9bacccae54cd449821416199f70c4dd2fcb9be4'/>
<id>urn:sha1:a9bacccae54cd449821416199f70c4dd2fcb9be4</id>
<content type='text'>
The "help" builtin has been able to emit configuration variables since
e17ca926371 (completion: drop the hard coded list of config vars,
2018-05-26), but it hasn't produced exactly the format the completion
script wanted. Let's do that.

We got partway there in 2675ea1cc0f (completion: use 'sort -u' to
deduplicate config variable names, 2019-08-13) and
d9438873c4d (completion: deduplicate configuration sections,
2019-08-13), but after both we still needed some sorting,
de-duplicating and awk post-processing of the list.

We can instead simply do the relevant parsing ourselves (we were doing
most of it already), and call string_list_remove_duplicates() after
already sorting the list, so the caller doesn't need to invoke "sort
-u". The "--config-for-completion" output is the same as before after
being passed through "sort -u".

Then add a new "--config-sections-for-completion" option. Under that
output we'll emit config sections like "alias" (instead of "alias." in
the --config-for-completion output).

We need to be careful to leave the "--config-for-completion" option
compatible with users git, but are still running a shell with an older
git-completion.bash. If we e.g. changed the option name they'd see
messages about git-completion.bash being unable to find the
"--config-for-completion" option.

Such backwards compatibility isn't something we should bend over
backwards for, it's only helping users who:

 * Upgrade git
 * Are in an old shell
 * The git-completion.bash in that shell hasn't cached the old
   "--config-for-completion" output already.

But since it's easy in this case to retain compatibility, let's do it,
the older versions of git-completion.bash won't care that the input
they get doesn't change after a "sort -u".

While we're at it let's make "--config-for-completion" die if there's
anything left over in "argc", and do the same in the new
"--config-sections-for-completion" option.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pull: remove support for `--rebase=preserve`</title>
<updated>2021-09-08T04:45:32Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-09-07T21:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52f1e82178e75bdf876799770922bc34fdf6fae4'/>
<id>urn:sha1:52f1e82178e75bdf876799770922bc34fdf6fae4</id>
<content type='text'>
In preparation for `git-rebase--preserve-merges.sh` entering its after
life, we remove this (deprecated) option that would still rely on it.

To help users transition who still did not receive the memo about the
deprecation, we offer a helpful error message instead of throwing our
hands in the air and saying that we don't know that option, never heard
of it.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fc/completion-updates'</title>
<updated>2021-09-03T20:49:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-03T20:49:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77b063cd3528c10ec10614a4467dce8baab55dce'/>
<id>urn:sha1:77b063cd3528c10ec10614a4467dce8baab55dce</id>
<content type='text'>
Command line completion updates.

* fc/completion-updates:
  completion: bash: add correct suffix in variables
  completion: bash: fix for multiple dash commands
  completion: bash: fix for suboptions with value
  completion: bash: fix prefix detection in branch.*
</content>
</entry>
<entry>
<title>completion: bash: add correct suffix in variables</title>
<updated>2021-08-18T18:17:26Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-08-16T09:10:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be6444d1ca96fdd702b383de860e243aa7e65619'/>
<id>urn:sha1:be6444d1ca96fdd702b383de860e243aa7e65619</id>
<content type='text'>
__gitcomp automatically adds a suffix, but __gitcomp_nl and others
don't, we need to specify a space by default.

Can be tested with:

  git config branch.autoSetupMe&lt;tab&gt;

This fix only works for versions of bash greater than 4.0, before that
"local sfx" creates an empty string, therefore the unset expansion
doesn't work. The same happens in zsh.

Therefore we don't add the test for that for now.

The correct fix for all shells requires semantic changes in __gitcomp,
but that can be done later.

Cc: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Tested-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: bash: fix for multiple dash commands</title>
<updated>2021-08-18T18:17:25Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-08-16T09:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3cc916acc2e0f92c05e07c82c83b370e7d31247'/>
<id>urn:sha1:f3cc916acc2e0f92c05e07c82c83b370e7d31247</id>
<content type='text'>
Otherwise options of commands like 'for-each-ref' are not completed.

Tested-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: bash: fix for suboptions with value</title>
<updated>2021-08-18T18:17:25Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-08-16T09:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e9f2118ddfad4ae5e37adc7637acc9daf4ac8c9c'/>
<id>urn:sha1:e9f2118ddfad4ae5e37adc7637acc9daf4ac8c9c</id>
<content type='text'>
We need to ignore options that don't start with -- as well.

Depending on the value of COMP_WORDBREAKS the last word could be
duplicated otherwise.

Can be tested with:

  git merge -X diff-algorithm=&lt;tab&gt;

Tested-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
