<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/contrib/completion, branch v2.21.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.21.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.21.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-01-18T21:49:54Z</updated>
<entry>
<title>Merge branch 'cy/zsh-completion-SP-in-path'</title>
<updated>2019-01-18T21:49:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-18T21:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b84e2977534b677ae1ac8670489002637fab6438'/>
<id>urn:sha1:b84e2977534b677ae1ac8670489002637fab6438</id>
<content type='text'>
With zsh, "git cmd path&lt;TAB&gt;" was completed to "git cmd path name"
when the completed path has a special character like SP in it,
without any attempt to keep "path name" a single filename.  This
has been fixed to complete it to "git cmd path\ name" just like
Bash completion does.

* cy/zsh-completion-SP-in-path:
  completion: treat results of git ls-tree as file paths
  zsh: complete unquoted paths with spaces correctly
</content>
</entry>
<entry>
<title>completion: fix typo in git-completion.bash</title>
<updated>2019-01-03T21:34:01Z</updated>
<author>
<name>Chayoung You</name>
<email>yousbe@gmail.com</email>
</author>
<published>2018-12-26T16:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06506149826b9eda92f065fdc073c94fdcea459e'/>
<id>urn:sha1:06506149826b9eda92f065fdc073c94fdcea459e</id>
<content type='text'>
Signed-off-by: Chayoung You &lt;yousbe@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: treat results of git ls-tree as file paths</title>
<updated>2019-01-03T19:48:18Z</updated>
<author>
<name>Chayoung You</name>
<email>yousbe@gmail.com</email>
</author>
<published>2019-01-01T14:05:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d54f528c74604b289ce7237cd30a1cfc5511f18'/>
<id>urn:sha1:6d54f528c74604b289ce7237cd30a1cfc5511f18</id>
<content type='text'>
Let's say there are files named 'foo bar.txt', and 'abc def/test.txt' in
repository. When following commands trigger a completion:

    git show HEAD:fo&lt;Tab&gt;
    git show HEAD:ab&lt;Tab&gt;

The completion results in bash/zsh:

    git show HEAD:foo bar.txt
    git show HEAD:abc def/

Where the both of them have an unescaped space in paths, so they'll be
misread by git. All entries of git ls-tree either a filename or a
directory, so __gitcomp_file() is proper rather than __gitcomp_nl().

Note the commit f12785a3, which handles quoted paths properly. Like this
case, we should dequote $cur_ for ?*:* case. For example, let's say
there is untracked directory 'abc deg', then trigger a completion:

    git show HEAD:abc\ de&lt;Tab&gt;
    git show HEAD:'abc de&lt;Tab&gt;
    git show HEAD:"abc de&lt;Tab&gt;

should uniquely complete 'abc def', but bash completes 'abc def' and
'abc deg' instead. In zsh, triggering a completion:

    git show HEAD:abc\ def/&lt;Tab&gt;

should complete 'test.txt', but nothing comes. The both problems will be
resolved by dequoting paths.

__git_complete_revlist_file() passes arguments to __gitcomp_nl() where
the first one is a list something like:

    abc def/Z
    foo bar.txt Z

where Z is the mark of the EOL.

- The trailing space of blob in __git ls-tree | sed.
  It makes the completion results become:

      git show HEAD:foo\ bar.txt\ &lt;CURSOR&gt;

  So git will try to find a file named 'foo bar.txt ' instead.

- The trailing slash of tree in __git ls-tree | sed.
  It makes the completion results on zsh become:

      git show HEAD:abc\ def/ &lt;CURSOR&gt;

  So that the last space on command like should be removed on zsh to
  complete filenames under 'abc def/'.

Signed-off-by: Chayoung You &lt;yousbe@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>zsh: complete unquoted paths with spaces correctly</title>
<updated>2019-01-03T19:48:13Z</updated>
<author>
<name>Chayoung You</name>
<email>yousbe@gmail.com</email>
</author>
<published>2019-01-01T14:05:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a478b36aa1f202aed207a230def66563227f30e'/>
<id>urn:sha1:7a478b36aa1f202aed207a230def66563227f30e</id>
<content type='text'>
The following is the description of -Q flag of zsh compadd [1]:

    This flag instructs the completion code not to quote any
    metacharacters in the words when inserting them into the command
    line.

Let's say there is a file named 'foo bar.txt' in repository, but it's
not yet added to the repository. Then the following command triggers a
completion:

    git add fo&lt;Tab&gt;
    git add 'fo&lt;Tab&gt;
    git add "fo&lt;Tab&gt;

The completion results in bash:

    git add foo\ bar.txt
    git add 'foo bar.txt'
    git add "foo bar.txt"

While them in zsh:

    git add foo bar.txt
    git add 'foo bar.txt'
    git add "foo bar.txt"

The first one, where the pathname is not enclosed in quotes, should
escape the space with a backslash, just like bash completion does.
Otherwise, this leads git to think there are two files; foo, and
bar.txt.

The main cause of this behavior is __gitcomp_file_direct(). The both
implementions of bash and zsh are called with an argument 'foo bar.txt',
but only bash adds a backslash before a space on command line.

[1]: http://zsh.sourceforge.net/Doc/Release/Completion-Widgets.html

Signed-off-by: Chayoung You &lt;yousbe@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/complete-format-patch'</title>
<updated>2018-11-13T13:37:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-13T13:37:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95182c65d844e799e80a8f8997e357cdf8a3c7a6'/>
<id>urn:sha1:95182c65d844e799e80a8f8997e357cdf8a3c7a6</id>
<content type='text'>
The support for format-patch (and send-email) by the command-line
completion script (in contrib/) has been simplified a bit.

* nd/complete-format-patch:
  completion: use __gitcomp_builtin for format-patch
</content>
</entry>
<entry>
<title>Merge branch 'nd/completion-negation'</title>
<updated>2018-11-06T06:50:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-06T06:50:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ffcf754dacea247c15dd78a61f0eebb4493bc75'/>
<id>urn:sha1:9ffcf754dacea247c15dd78a61f0eebb4493bc75</id>
<content type='text'>
The command line completion machinery (in contrib/) has been
updated to allow the completion script to tweak the list of options
that are reported by the parse-options machinery correctly.

* nd/completion-negation:
  completion: fix __gitcomp_builtin no longer consider extra options
</content>
</entry>
<entry>
<title>completion: use __gitcomp_builtin for format-patch</title>
<updated>2018-11-06T04:22:30Z</updated>
<author>
<name>Duy Nguyen</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-03T06:03:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=13374987dd889858758afef458bd8a8cbf15bb4d'/>
<id>urn:sha1:13374987dd889858758afef458bd8a8cbf15bb4d</id>
<content type='text'>
This helps format-patch gain completion for a couple new options,
notably --range-diff.

Since send-email completion relies on $__git_format_patch_options
which is now reduced, we need to do something not to regress
send-email completion.

The workaround here is implement --git-completion-helper in
send-email.perl just as a bridge to "format-patch --git-completion-helper".
This is enough to use __gitcomp_builtin on send-email (to take
advantage of caching).

In the end, send-email.perl can probably reuse the same info it passes
to GetOptions() to generate full --git-completion-helper output so
that we don't need to keep track of its options in git-completion.bash
anymore. But that's something for another boring day.

Helped-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dl/mergetool-gui-option'</title>
<updated>2018-10-30T06:43:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-30T06:43:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=87c15d1ca969e978fb8d04bc486a28025d71e6b2'/>
<id>urn:sha1:87c15d1ca969e978fb8d04bc486a28025d71e6b2</id>
<content type='text'>
"git mergetool" learned to take the "--[no-]gui" option, just like
"git difftool" does.

* dl/mergetool-gui-option:
  doc: document diff/merge.guitool config keys
  completion: support `git mergetool --[no-]gui`
  mergetool: accept -g/--[no-]gui as arguments
</content>
</entry>
<entry>
<title>Merge branch 'du/cherry-is-plumbing'</title>
<updated>2018-10-26T05:22:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-26T05:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eff5d693ad5ff28daf2244ce2618896e87cccb2b'/>
<id>urn:sha1:eff5d693ad5ff28daf2244ce2618896e87cccb2b</id>
<content type='text'>
Doc update to mark "git cherry" as a plumbing command.

* du/cherry-is-plumbing:
  doc: move git-cherry to plumbing
</content>
</entry>
<entry>
<title>completion: support `git mergetool --[no-]gui`</title>
<updated>2018-10-25T05:01:16Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2018-10-24T16:25:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57ba181270e07ba66c55c9af466e95ab9f739680'/>
<id>urn:sha1:57ba181270e07ba66c55c9af466e95ab9f739680</id>
<content type='text'>
Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Anmol Mago &lt;anmolmago@gmail.com&gt;
Signed-off-by: Brian Ho &lt;briankyho@gmail.com&gt;
Signed-off-by: David Lu &lt;david.lu97@outlook.com&gt;
Signed-off-by: Ryan Wang &lt;shirui.wang@hotmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
