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

Re: `@` alias for `HEAD` not working in `git push -u origin @`

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 12, 2019, 10:29 UTC
Message-ID
<nycvar.QRO.7.76.6.1907121228110.47@tvgsbejvaqbjf.bet>
In-Reply-To
<20190711144828.GH9224@genre.crustytoothpaste.net>
Hi brian,
On Thu, 11 Jul 2019, brian m. carlson wrote:
Show 11 quoted lines
> On 2019-07-11 at 09:46:26, Johannes Schindelin wrote:
>
> > Since I have your attention and since I am interested in a related issue
> > (when I wanted to propose a GSoC mini project to let `git fetch <remote>
> > @` expand the `@` to the current (local) branch name, Matthieu Moy
> > pointed out that `git fetch --current <remote>` might be a better UI):
> > what does your patch do with `git fetch`'s refspec arguments?
>
> I haven't checked. I believe it would resolve "git fetch origin @" to
> "git fetch origin HEAD" and "git fetch origin @:refs/heads/master" to
> "git fetch origin HEAD:refs/heads/master".

That sounds like a sane behavior, as `@` on the "src" side of a refspec that tries to fetch from a remote repository should probably not expand to a _local_ branch.

> I can add some additional tests for this case, although I'm not
> especially sure that it provides useful behavior people will want.
Nah, from my side this is not necessary.

Ciao, Dscho

Previous: brian m. carlsonNext: Jeff King
Message 5 of 7 in “`@` alias for `HEAD` not working in `git push -u origin @`”
  1. Mark FlorianJul 10, 2019
  2. brian m. carlsonJul 10, 2019
  3. Johannes SchindelinJul 11, 2019
  4. brian m. carlsonJul 11, 2019
  5. Johannes SchindelinJul 12, 2019
  6. Jeff KingJul 31, 2019
  7. Junio C HamanoJul 31, 2019

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.