git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git completion not using ls-remote to auto-complete during push

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jun 18, 2015, 11:29 UTC
Message-ID
<1434626973-4801-1-git-send-email-szeder@ira.uka.de>
In-Reply-To
<CAHd499Dk44Fq5c_wadxT_kuCs5BdkRwKZWOHyAgE4oi7pezxPw@mail.gmail.com>
Quoting Robert Dailey <rcdailey.lists@gmail.com>
Show 9 quoted lines
> I do the following:
> 
> $ git push origin :topic
> 
> If I stop halfway through typing 'topic' and hit TAB, auto-completion
> does not work if I do not have a local branch by that name (sometimes
> I delete my local branch first, then I push to delete it remotely). I
> thought that git completion code was supposed to use ls-remote to auto
> complete refs used in push operations. Is this supposed to work?

It's intentional. Running 'git ls-remote' with a far away remote can take ages, so instead we grab the refs on the remote from the locally stored refs under 'refs/remotes/<remote>/'.

See e832f5c096 (completion: avoid ls-remote in certain scenarios, 2013-05-28). The commit message mentions that you can "force" completion of remote refs via 'git ls-remote' by starting with the full refname, i.e. 'refs/<TAB>', however, that seems to work only on the left hand side of the colon in the push refspec.

Gábor
Previous: Stefan NäweNext: Robert Dailey
Message 3 of 6 in “Git completion not using ls-remote to auto-complete during push”
  1. Robert DaileyJun 17, 2015
  2. Stefan NäweJun 18, 2015
  3. SZEDER GáborJun 18, 2015
  4. Robert DaileyJun 18, 2015
  5. SZEDER GáborJun 18, 2015
  6. Robert DaileyJun 18, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.