<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion/git-completion.bash, branch v2.26.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-03-09T18:21:20Z</updated>
<entry>
<title>Merge branch 'kk/complete-diff-color-moved'</title>
<updated>2020-03-09T18:21:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-09T18:21:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4fd114ffca1e3c5fff48df382298c2ef9a32f67'/>
<id>urn:sha1:a4fd114ffca1e3c5fff48df382298c2ef9a32f67</id>
<content type='text'>
Completion update.

* kk/complete-diff-color-moved:
  completion: add diff --color-moved[-ws]
</content>
</entry>
<entry>
<title>Merge branch 'pb/am-show-current-patch'</title>
<updated>2020-03-09T18:21:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-09T18:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e0d717537547e8fcba441e4f65237c7fd227a34'/>
<id>urn:sha1:0e0d717537547e8fcba441e4f65237c7fd227a34</id>
<content type='text'>
"git am --short-current-patch" is a way to show the piece of e-mail
for the stopped step, which is not suitable to directly feed "git
apply" (it is designed to be a good "git am" input).  It learned a
new option to show only the patch part.

* pb/am-show-current-patch:
  am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch
  am: support --show-current-patch=raw as a synonym for--show-current-patch
  am: convert "resume" variable to a struct
  parse-options: convert "command mode" to a flag
  parse-options: add testcases for OPT_CMDMODE()
</content>
</entry>
<entry>
<title>completion: add diff --color-moved[-ws]</title>
<updated>2020-02-24T19:09:47Z</updated>
<author>
<name>Kir Kolyshkin</name>
<email>kolyshkin@gmail.com</email>
</author>
<published>2020-02-21T20:15:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd0bc175576d74faf5c7bfe626c09cfea884cc6a'/>
<id>urn:sha1:fd0bc175576d74faf5c7bfe626c09cfea884cc6a</id>
<content type='text'>
These options are available since git v2.15, but somehow
eluded from the completion script.

Note that while --color-moved-ws= accepts comma-separated
list of values, there is no (easy?) way to make it work
with completion (see e.g. [1]).

[1]: https://github.com/scop/bash-completion/issues/240

Acked-by: Matheus Tavares Bernardino &lt;matheus.bernardino@usp.br&gt;
Signed-off-by: Kir Kolyshkin &lt;kolyshkin@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch</title>
<updated>2020-02-20T21:20:41Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-02-20T14:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa416b22ea73321aba94c3c96db0491fb25ea7ea'/>
<id>urn:sha1:aa416b22ea73321aba94c3c96db0491fb25ea7ea</id>
<content type='text'>
When "git am --show-current-patch" was added in commit 984913a210 ("am:
add --show-current-patch", 2018-02-12), "git am" started recommending it
as a replacement for .git/rebase-merge/patch.  Unfortunately the suggestion
is somewhat misguided; for example, the output of "git am --show-current-patch"
cannot be passed to "git apply" if it is encoded as quoted-printable
or base64.  Add a new mode to "git am --show-current-patch" in order to
straighten the suggestion.

Reported-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>am: support --show-current-patch=raw as a synonym for--show-current-patch</title>
<updated>2020-02-20T21:20:40Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-02-20T14:15:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3b4822899dc4ddca688de285f01e1d12aeb33b6'/>
<id>urn:sha1:f3b4822899dc4ddca688de285f01e1d12aeb33b6</id>
<content type='text'>
When "git am --show-current-patch" was added in commit 984913a210 ("am:
add --show-current-patch", 2018-02-12), "git am" started recommending it
as a replacement for .git/rebase-merge/patch.  Unfortunately the suggestion
is somewhat misguided; for example, the output "git am --show-current-patch"
cannot be passed to "git apply" if it is encoded as quoted-printable or
base64.  To simplify worktree operations and to avoid that users poke into
.git, it would be better if "git am" also provided a mode that copies
.git/rebase-merge/patch to stdout.

One possibility could be to have completely separate options, introducing
for example --show-current-message (for .git/rebase-apply/NNNN)
and --show-current-diff (for .git/rebase-apply/patch), while possibly
deprecating --show-current-patch.

That would even remove the need for the first two patches in the series.
However, the long common prefix would have prevented using an abbreviated
option such as "--show".  Therefore, I chose instead to add a string
argument to --show-current-patch.  The new argument is optional, so that
"git am --show-current-patch"'s behavior remains backwards-compatible.

The next choice to make is how to handle multiple --show-current-patch
options.  Right now, something like "git am --abort --show-current-patch"
is rejected, and the previous suggestion would likewise have naturally
rejected a command line like

	git am --show-current-message --show-current-diff

Therefore, I decided to also reject for example

	git am --show-current-patch=diff --show-current-patch=raw

In other words the whole of --show-current-patch=xxx (including the
optional argument) is treated as the command mode.  I found this to be
more consistent and intuitive, even though it differs from the usual
"last one wins" semantics of the git command line.

Add the code to parse submodes based on the above design, where for now
"raw" is the only valid submode.  "raw" prints the full e-mail message
just like "git am --show-current-patch".

Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'mt/sparse-checkout-doc-update'</title>
<updated>2020-02-05T22:35:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-02-05T22:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea46d9097bd9f5c215cad65e090884869a4c3451'/>
<id>urn:sha1:ea46d9097bd9f5c215cad65e090884869a4c3451</id>
<content type='text'>
Doc update.

* mt/sparse-checkout-doc-update:
  completion: add support for sparse-checkout
  doc: sparse-checkout: mention --cone option
</content>
</entry>
<entry>
<title>Merge branch 'sg/completion-worktree'</title>
<updated>2020-01-30T22:17:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-01-30T22:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fec1ff97c2b3c9c5db7e8f2df8d2c81cb94972fd'/>
<id>urn:sha1:fec1ff97c2b3c9c5db7e8f2df8d2c81cb94972fd</id>
<content type='text'>
The command line completion (in contrib/) learned to complete
subcommands and arguments to "git worktree".

* sg/completion-worktree:
  completion: list paths and refs for 'git worktree add'
  completion: list existing working trees for 'git worktree' subcommands
  completion: simplify completing 'git worktree' subcommands and options
  completion: return the index of found word from __git_find_on_cmdline()
  completion: clean up the __git_find_on_cmdline() helper function
  t9902-completion: add tests for the __git_find_on_cmdline() helper
</content>
</entry>
<entry>
<title>completion: add support for sparse-checkout</title>
<updated>2020-01-23T21:20:42Z</updated>
<author>
<name>Matheus Tavares</name>
<email>matheus.bernardino@usp.br</email>
</author>
<published>2020-01-23T19:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d031049da356fc345d75c51ec1fbfbeab0f1c8cb'/>
<id>urn:sha1:d031049da356fc345d75c51ec1fbfbeab0f1c8cb</id>
<content type='text'>
Signed-off-by: Matheus Tavares &lt;matheus.bernardino@usp.br&gt;
Acked-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: list paths and refs for 'git worktree add'</title>
<updated>2020-01-15T22:06:13Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-12-19T15:09:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7d5ecd775de33878f00055e0024a003ab4edfbce'/>
<id>urn:sha1:7d5ecd775de33878f00055e0024a003ab4edfbce</id>
<content type='text'>
Complete paths after 'git worktree add &lt;TAB&gt;' and refs after 'git
worktree add -b &lt;TAB&gt;' and 'git worktree add some/dir &lt;TAB&gt;'.

Uncharacteristically for a Git command, 'git worktree add' takes a
mandatory path parameter before a commit-ish as its optional last
parameter.  In addition, it has both standalone --options and options
with a mandatory unstuck parameter ('-b &lt;new-branch&gt;').  Consequently,
trying to complete refs for that last optional commit-ish parameter
resulted in a more convoluted than usual completion function, but
hopefully all the included comments will make it not too hard to
digest.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: list existing working trees for 'git worktree' subcommands</title>
<updated>2020-01-15T22:06:13Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-12-19T15:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3027e4f9a8210944e6157aadc52aba58a2182398'/>
<id>urn:sha1:3027e4f9a8210944e6157aadc52aba58a2182398</id>
<content type='text'>
Complete the paths of existing working trees for 'git worktree's
'move', 'remove', 'lock', and 'unlock' subcommands.

Note that 'git worktree list --porcelain' shows absolute paths, so for
simplicity's sake we'll complete full absolute paths as well (as
opposed to turning them into relative paths by finding common leading
directories between $PWD and the working tree's path and removing
them, risking trouble with symbolic links or Windows drive letters; or
completing them one path component at a time).

Never list the path of the main working tree, as it cannot be moved,
removed, locked, or unlocked.

Ideally we would only list unlocked working trees for the 'move',
'remove', and 'lock' subcommands, and only locked ones for 'unlock'.
Alas, 'git worktree list --porcelain' doesn't indicate which working
trees are locked, so for now we'll complete the paths of all existing
working trees.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
