{"thread":{"id":"54082","subject":"Bash completion does not offer bare name origin where remote head is set","startedAt":"2020-08-21T14:03:30Z","lastAt":"2020-08-21T14:03:30Z","messageCount":1,"participants":["Paul Jolly"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"404139","messageId":"CACoUkn7D52ox2MgUfS2uQtLa28twccfxnQnUteVV_yFfVLFQdQ@mail.gmail.com","threadId":"54082","inReplyTo":null,"subject":"Bash completion does not offer bare name origin where remote head is set","fromName":"Paul Jolly","fromEmail":"paul@myitcv.io","sentAt":"2020-08-21T14:03:12Z","receivedAt":"2020-08-21T14:03:30Z","isPatch":false,"sender":{"key":"paul@myitcv.io","avatar":"https://gravatar.com/avatar/6a83179b2ef0386af693cc03a9c50ea897f5246c5dcc0fa5d126171ba17c3a63?d=mp&s=160"},"body":"Hi,\n\nIn some of my repositories I use either:\n\n    git remote set-head origin -a\n\nor the more explicit:\n\n    git remote set-head origin main\n\nto set the remote default branch. My understanding is that this then\nallows me to use the name \"origin\" to refer to (in the second case)\n\"origin/main\".\n\nHowever, testing git version 2.28.0.308.g675a4aaf3b, bash completion\ndoes not offer the name  \"origin\" as a valid completion.\n\nFor example if I type:\n\n    git checkout ori\n\nand hit <Tab>, the command completes to:\n\n    git checkout origin/\n\n(notice the trailing slash). Which means I then either need to hit\n<Backspace> to remove the slash, or I have to remember the default\nbranch name of the remote. Either is a slight annoyance... which\nmultiplied many times a day becomes painful!\n\nIdeally I would like the <Tab> completion to result in:\n\n    git checkout origin\n\n(notice no trailing slash), i.e to know that the bare name \"origin\" is\nvalid by itself.\n\nWith many repositories renaming their default branch from master to\nmain, git remote set-head has become essential. It would be ideal to\nhave completion help support this.\n\nMany thanks,\n\n\nPaul\n"}]}