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

Re: [PATCH] completion: git: split __git_heads into local and remote

Daniel Hahler wrote on Fri, May 08, 2015 at 15:41:01 +0200:
> From: Daniel Hahler <git@xxxxxxxxxx>
> It is useful to have this distinction visually.

Thanks, I think this is a good change.

I have one concern, however.  The 'heads' tag is split into two new tags:

> -  _wanted heads expl head compadd "$@" -a - heads
> +  _wanted heads-local expl "local head" compadd "$@" -a - heads
> +  _wanted heads-remote expl "remote head" compadd "$@" -a - heads

That's a backwards-incompatible change.  (If people have "heads" in
their tag-order styles, their setup will be silently broken.)  I'm not
sure how this should be handled.

I spoke with Daniel on IRC and we both preferred to keep the change and
mention it in NEWS as an incompatibility.  (I went ahead and drafted
this; patch enclosed.)

Personally, I'm a little torn on this: I keep thinking there might be
a way to split the 'heads' tag without breaking existing setups that
refer to it.  So far, I haven't found any.  I'd still vote for merging
the patch, though, backwards incompatibility notwithstanding.  (Since
the breakage — heads not being offered as completions — would be easily
noticeable by the user, harmless, and would not affect the default



P.S. Peter — are you waiting on this for 5.0.8?  Normally I'd assume we
can take our time getting the patch right, but I wouldn't want to be the
late-boarding passenger whom everyone waits for.


diff --git a/README b/README
index 142daad..73190a5 100644
--- a/README
+++ b/README
@@ -117,6 +117,12 @@ New behaviour:
+4) The _git completion used to offer both local and remote heads under the
+tag 'heads'.  The tag has now been split into 'heads-local' and
+'heads-remote' in all contexts that existed in 5.0.7.  The --fixup/--squash
+context still uses the tag 'heads' (but this may change in a future release).
 Incompatibilities between 5.0.2 and 5.0.5

> This also uses `--format=%(refname:short)` directly with `git
> for-each-ref`.

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