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

Re: Notation for current branch?

From
ryenus <ryenus@gmail.com>
Date
Sep 1, 2016, 15:51 UTC
Message-ID
<CAKkAvaxD75sC-S7QBG6gXYbSMmBz5hpe8ZEYRRUt_BE99yvrYg@mail.gmail.com>
In-Reply-To
<CA+P7+xpz8UNt6bBgrJvsHdFE+MQ4J80K1ed+b41XH_CG6HYYTA@mail.gmail.com>
> Jacob Keller <jacob.keller@gmail.com> writes:
> "git symbolic-ref" seems like the right thing if you need to obtain
> the current branch name, and there's no reason to not just use HEAD
> there.

Really? Any reason why `git rev-parse --abbrev-ref '@{-1}'` works, but not `git symbolic-ref '@{-1}'`, or even `git symbolic-ref @`?

BTW, possible to make the curly brances optional in `@{n}`, `@{-n}`, and the alike? coz they require quoting/escaping, and more typing :(

Previous: Jacob KellerNext: ryenus
Message 7 of 9 in “Notation for current branch?”
  1. ryenusAug 28, 2016
  2. Kevin DaudtAug 28, 2016
  3. Jakub NarębskiAug 28, 2016
  4. Jacob KellerAug 29, 2016
  5. Junio C HamanoAug 29, 2016
  6. Jacob KellerAug 29, 2016
  7. ryenusSep 1, 2016
  8. ryenusAug 30, 2016
  9. Junio C HamanoAug 30, 2016

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.