* [PATCH] git add -p file completion
@ 2009-03-31 16:04 Simon Ruderich
2009-03-31 18:24 ` Nikolai Weibull
0 siblings, 1 reply; 3+ messages in thread
From: Simon Ruderich @ 2009-03-31 16:04 UTC (permalink / raw)
To: zsh-workers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I found a minor bug in _git completion. It doesn't allow file
completions after `git add -p` which works fine with git. The
following patch fixes this.
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8c414b8..91607d3 100644
- --- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1331,7 +1332,7 @@ _git-add () {
'(-v --verbose)'{-v,--verbose}'[show files as they are added]' \
'(-f --force)'{-f,--force}'[allow adding otherwise ignored files]' \
'(-i --interactive : -)'{-i,--interactive}'[add contents interactively to the index]' \
- - '(-p --patch : -)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
+ '(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
'(-u --update)'{-u,--update}'[update only files git already knows about]' \
'(-A --all)'{-A,--all}'[act as both add . and add -u]' \
'(-N --intent-to-add)'{-N,--intent-to-add}'[record only that the path will be added later]' \
By the way, is the usage of : - documented somewhere in the
completion man page? I couldn't find it.
Thanks,
Simon
- --
+ privacy is necessary
+ using http://gnupg.org
+ public key id: 0x6115F804EFB33229
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAknSPx8ACgkQYRX4BO+zMik57QCfehWFannV0in/UuoGzLzlrEcd
tqYAoKmCLpZB3GSFR9HyLRtvKLiUyFTn
=zYYM
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] git add -p file completion
2009-03-31 16:04 [PATCH] git add -p file completion Simon Ruderich
@ 2009-03-31 18:24 ` Nikolai Weibull
2009-03-31 22:27 ` Simon Ruderich
0 siblings, 1 reply; 3+ messages in thread
From: Nikolai Weibull @ 2009-03-31 18:24 UTC (permalink / raw)
To: Simon Ruderich; +Cc: zsh-workers
On Tue, Mar 31, 2009 at 18:04, Simon Ruderich <simon@ruderich.org> wrote:
> - - '(-p --patch : -)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
> + '(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
> By the way, is the usage of : - documented somewhere in the
> completion man page? I couldn't find it.
Yes, just search for _arguments and read up on it.
By the way, -A and -u are mutually exclusive. Care to create a patch
for that as well?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] git add -p file completion
2009-03-31 18:24 ` Nikolai Weibull
@ 2009-03-31 22:27 ` Simon Ruderich
0 siblings, 0 replies; 3+ messages in thread
From: Simon Ruderich @ 2009-03-31 22:27 UTC (permalink / raw)
To: zsh-workers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, Mar 31, 2009 at 08:24:17PM +0200, Nikolai Weibull wrote:
> On Tue, Mar 31, 2009 at 18:04, Simon Ruderich wrote:
>
>> - - '(-p --patch : -)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
>> + '(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
>
>> By the way, is the usage of : - documented somewhere in the
>> completion man page? I couldn't find it.
>
> Yes, just search for _arguments and read up on it.
Thanks, found it.
> By the way, -A and -u are mutually exclusive. Care to create a patch
> for that as well?
This should work (I hope), contains the other patch as well:
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8c414b8..534307a 100644
- --- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1331,9 +1332,9 @@ _git-add () {
'(-v --verbose)'{-v,--verbose}'[show files as they are added]' \
'(-f --force)'{-f,--force}'[allow adding otherwise ignored files]' \
'(-i --interactive : -)'{-i,--interactive}'[add contents interactively to the index]' \
- - '(-p --patch : -)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
- - '(-u --update)'{-u,--update}'[update only files git already knows about]' \
- - '(-A --all)'{-A,--all}'[act as both add . and add -u]' \
+ '(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \
+ '(-u --update -A --all)'{-u,--update}'[update only files git already knows about]' \
+ '(-A --all -u --update)'{-A,--all}'[act as both add . and add -u]' \
'(-N --intent-to-add)'{-N,--intent-to-add}'[record only that the path will be added later]' \
'--refresh[do not add files, but refresh their stat() info in the index]' \
'--ignore-errors[continue adding if an error occurs]' \
Simon
- --
+ privacy is necessary
+ using http://gnupg.org
+ public key id: 0x6115F804EFB33229
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAknSmO0ACgkQYRX4BO+zMinoDACgyxiYWew4BJnN/b06heEtrcGW
sLEAnR8gqf2wZ2vvnkygfdbKIobL5AR0
=pozu
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-31 22:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-31 16:04 [PATCH] git add -p file completion Simon Ruderich
2009-03-31 18:24 ` Nikolai Weibull
2009-03-31 22:27 ` Simon Ruderich
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).