Patchwork fixing an issue with zsh completion that occurs with long branch or tag names

login
register
mail settings
Submitter Johannes Schlatow
Date Jan. 17, 2013, 1:02 a.m.
Message ID <50F74D8F.4050601@schlatow.name>
Download mbox | patch
Permalink /patch/672/
State Accepted
Delegated to: Matt Mackall
Headers show

Comments

Johannes Schlatow - Jan. 17, 2013, 1:02 a.m.
# HG changeset patch
# User Johannes Schlatow <johannes@schlatow.name>
# Date 1358384150 -3600
# Node ID 75f74f803081bc10e4d21102c9882038fd9ed434
# Parent  ec4fc4474af7dcedd182c4f9153884f4e852e089
zsh_completion: fix issue with overlong branch/tag names
Matt Mackall - Jan. 17, 2013, 6:15 p.m.
On Thu, 2013-01-17 at 02:02 +0100, Johannes Schlatow wrote:
> # HG changeset patch
> # User Johannes Schlatow <johannes@schlatow.name>
> # Date 1358384150 -3600
> # Node ID 75f74f803081bc10e4d21102c9882038fd9ed434
> # Parent  ec4fc4474af7dcedd182c4f9153884f4e852e089
> zsh_completion: fix issue with overlong branch/tag names

These three are queued for default, thanks.
Bryan O'Sullivan - March 22, 2013, 8:55 p.m.
On Fri, Mar 22, 2013 at 3:56 AM, Nikolaj Sjujskij <sterkrig@myopera.com>wrote:

> So, somebody please crew-*stable* fix for it (since Matt seems to be
> mostly absent), because I'm not sure that diff in ML would be meaningful
> and/or easy "appliable".
>

Someone who uses zsh is going to need to step in with a fix here.
Nikolaj Sjujskij - March 22, 2013, 9:29 p.m.
Den 2013-03-23 00:55:22 skrev Bryan O'Sullivan <bos@serpentine.com>:

> On Fri, Mar 22, 2013 at 3:56 AM, Nikolaj Sjujskij  
> <sterkrig@myopera.com>wrote:
>
>> So, somebody please crew-*stable* fix for it (since Matt seems to be
>> mostly absent), because I'm not sure that diff in ML would be meaningful
>> and/or easy "appliable".
>>
>
> Someone who uses zsh is going to need to step in with a fix here.

I can push a fix to some publicly available repo, if you mean that fix  
should be provided by zsh user as a changeset ready for inclusion. I'd  
send a patch, but I'm afraid there would be problems with \r, like I said.
Gilles Moris - March 22, 2013, 9:55 p.m.
Nikolaj,

I confirm that removing \r fixes the problem.
Hopefully patchbomb will correctly strip it. Doing that for you.

Regards.
Gilles.
Gilles Moris - March 22, 2013, 10:21 p.m.
Of course, Mail Agent strips it.
Resending as a bundle.
Nikolaj Sjujskij - March 23, 2013, 8:43 a.m.
Den 2013-03-23 02:21:07 skrev Gilles Moris <gilles.moris@free.fr>:

> Of course, Mail Agent strips it.
  Yep, that's what I meant :)

> Resending as a bundle.
  Good idea, should have thought about it myself :)
Nikolaj Sjujskij - March 30, 2013, 9:03 a.m.
Den 2013-03-23 02:21:07 skrev Gilles Moris <gilles.moris@free.fr>:
> # HG changeset patch
> # User Nikolaj Sjujskij <sterkrig@myopera.com>
> # Date 1363989196 -3600
> # Node ID ff516bb09c17b68ad6b46cce3326a0bcd2ddcc1e
> # Parent  a07be895373394be66ba38b1ff111e26aca03ac8
> zsh_completion: fix trailing Carriage Return spoiling tag completion
>
> This was giving the following error:
> % hg up 2.5-r<Tab>
> (eval):1: bad substitution
> % hg up 2.5-r
>
> diff -r a07be8953733 -r ff516bb09c17 contrib/zsh_completion
> --- a/contrib/zsh_completion	Thu Feb 28 21:58:37 2013 -0600
> +++ b/contrib/zsh_completion	Fri Mar 22 22:53:16 2013 +0100
> @@ -176,7 +176,7 @@
>    do
>      tags+=(${tag/ #[0-9]#:*})
>    done
> -  (( $#tags )) && _describe -t tags 'tags' tags
> +  (( $#tags )) && _describe -t tags 'tags' tags
>  }
>  _hg_bookmarks() {
>    typeset -a bookmark bookmarks

> Of course, Mail Agent strips it.
> Resending as a bundle.
Hello, hello, anybody alive in this ML? It's the simplest patch I've ever  
seen here, and it fixes real problem. Please apply.
Augie Fackler - March 30, 2013, 5:35 p.m.
On Mar 30, 2013, at 5:03 AM, Nikolaj Sjujskij <sterkrig@myopera.com> wrote:

> Hello, hello, anybody alive in this ML? It's the simplest patch I've ever seen here, and it fixes real problem. Please apply.

Can you send your patch not as a bundle?
Nikolaj Sjujskij - March 30, 2013, 6:18 p.m.
Den 2013-03-30 21:35:36 skrev Augie Fackler <raf@durin42.com>:

>
> On Mar 30, 2013, at 5:03 AM, Nikolaj Sjujskij <sterkrig@myopera.com>  
> wrote:
>
>> Hello, hello, anybody alive in this ML? It's the simplest patch I've  
>> ever seen here, and it fixes real problem. Please apply.
>
> Can you send your patch not as a bundle?
Actually it *has* already been sent here in plain text by Gilles Moris  
(thanks to him), and I quoted it in my bump request. And of course, it was  
mangled. Because the patch only removes CR (\r, ^M) symbol on one line  
ending, and that kind of changes gets mangled in email. And it seems  
strange that it's such a big deal to actually apply it.

Patch

diff -r ec4fc4474af7 -r 75f74f803081 contrib/zsh_completion
--- a/contrib/zsh_completion    Thu Jan 17 01:06:00 2013 +0100
+++ b/contrib/zsh_completion    Thu Jan 17 01:55:50 2013 +0100
@@ -174,7 +174,7 @@ 

   _hg_cmd tags | while read tag
   do
-    tags+=(${tag/ #    [0-9]#:*})
+    tags+=(${tag/ #[0-9]#:*})
   done
   (( $#tags )) && _describe -t tags 'tags' tags
 }
@@ -198,7 +198,7 @@ 

   _hg_cmd branches | while read branch
   do
-    branches+=(${branch/ #    [0-9]#:*})
+    branches+=(${branch/ #[0-9]#:*})
   done
   (( $#branches )) && _describe -t branches 'branches' branches
 }