Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] completion: git: fix __git_commit_objects/__git_recent_commits



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18.05.2015 01:46, Daniel Shahaf wrote:
> Daniel Hahler wrote on Sun, May 17, 2015 at 19:37:53 +0200:
>> From: Daniel Hahler <git@xxxxxxxxxx>
>>
>> $pipestatus for `: foo` appears to be 0 always.
>> Explicitly declare `$commits` as associative array, and assign it
>> normally.
> 
> The change from sequential to associative array breaks __git_recent_commits.
> I assume you should revert the declaration change but keep the
> initialization change.

Thanks for catching that, pushed as suggested.

> Incidentally, _describe's documentation says colons should be escaped,
> so I think we also need something like this:
> 
> diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
> index 918f6be..a281597 100644
> --- a/Completion/Unix/Command/_git
> +++ b/Completion/Unix/Command/_git
> @@ -5672,7 +5672,7 @@ __git_recent_commits () {
>    for i j k in "$commits[@]" ; do
>      # Note: the after-the-colon part must be unique across the entire array;
>      # see workers/34768
> -    descr+=("$i:[$i] $k")
> +    descr+=("$i:[$i] ${k//:/\\:}")
>      j=${${j# \(}%\)} # strip leading ' (' and trailing ')'
>      for j in ${(s:, :)j}; do
>        if [[ $j == 'tag: '* ]] ; then
> 
> But I haven't tested this, and in any case I won't commit this until you
> finish pushing your outstanding changes (to avoid conflicts).

Should be good to get committed now - in case it works.


Regards,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iD8DBQFVWrIAfAK/hT/mPgARAnriAKDi3sptg2KRSZVxpNqjtrLsO9skUQCg0ToS
NU8Sc42Gu0K+Xqy5FOkH6Ow=
=dtto
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author