git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bash completion does not offer bare name origin where remote head is set
@ 2020-08-21 14:03 Paul Jolly
  0 siblings, 0 replies; only message in thread
From: Paul Jolly @ 2020-08-21 14:03 UTC (permalink / raw)
  To: git

Hi,

In some of my repositories I use either:

    git remote set-head origin -a

or the more explicit:

    git remote set-head origin main

to set the remote default branch. My understanding is that this then
allows me to use the name "origin" to refer to (in the second case)
"origin/main".

However, testing git version 2.28.0.308.g675a4aaf3b, bash completion
does not offer the name  "origin" as a valid completion.

For example if I type:

    git checkout ori

and hit <Tab>, the command completes to:

    git checkout origin/

(notice the trailing slash). Which means I then either need to hit
<Backspace> to remove the slash, or I have to remember the default
branch name of the remote. Either is a slight annoyance... which
multiplied many times a day becomes painful!

Ideally I would like the <Tab> completion to result in:

    git checkout origin

(notice no trailing slash), i.e to know that the bare name "origin" is
valid by itself.

With many repositories renaming their default branch from master to
main, git remote set-head has become essential. It would be ideal to
have completion help support this.

Many thanks,


Paul

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-21 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 14:03 Bash completion does not offer bare name origin where remote head is set Paul Jolly

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