zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] git checkout completion shows duplicated branch names
@ 2018-09-24 14:51 Marc Cornellà
  2018-09-24 16:04 ` Daniel Shahaf
  0 siblings, 1 reply; 9+ messages in thread
From: Marc Cornellà @ 2018-09-24 14:51 UTC (permalink / raw)
  To: zsh-workers

Steps to reproduce:

git init repo
cd repo
git commit --allow-empty -m 'Initial commit'
git checkout -b topic/foo
git checkout master

Now, when trying to complete to a branch name, here's what I see:

~/repo% git checkout <TAB>
e287376  -- [HEAD]    Initial commit (12 seconds ago)
topic/foo  master  -- Initial commit
HEAD                                                master
                                 topic/foo

Notice that branches appear twice. This only happens on versions newer
than 5.3.1, excluding this one.
A `git bisect` pointed me to commit e869952, which changed to using
the __git_recent_branches function,
which uses extracts branch names from the git reflog.

Furthermore, on versions prior to commit 4dddf3aa (< zsh-5.6), the
completion is even worse since a branch
is not fully completed even if there isn't any other branch with the
same prefix.

So typing this:

~/repo% git checkout topic/<TAB>
topic/foo  -- Initial commit
topic/foo

gets completed to `git checkout topic` instead of the full branch name.

So after version 5.6 and newer the bug is not that annoying because
the full branch name is indeed completed,
but there're still duplicated entries and I'd expect there to be
unique branch names.

If I knew enough about the completion system I would try to fix it,
but sometimes you have to let the hard stuff
to the pros.

Thanks,
Marc

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-25 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 14:51 [BUG] git checkout completion shows duplicated branch names Marc Cornellà
2018-09-24 16:04 ` Daniel Shahaf
2018-09-24 18:00   ` Daniel Shahaf
2018-09-25  0:24     ` Bart Schaefer
2018-09-25 16:50       ` Daniel Shahaf
2018-09-25  0:46     ` Oliver Kiddle
2018-09-25 16:43       ` Daniel Shahaf
2018-09-25 17:15         ` Bart Schaefer
2018-09-25 17:28           ` Daniel Shahaf

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).