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

Re: rev-parse: -- is sometimes a flag and sometimes an arg?

From
THTim Hockin <thockin@google.com>
Date
Aug 21, 2022, 00:39 UTC
Message-ID
<CAO_RewaZHL34WBaoXVyXh6ZNVuG+fi5uGUbpRMsc9N=orHzx1Q@mail.gmail.com>
In-Reply-To
<xmqq4jy6igb2.fsf@gitster.g>
Sorry, I assumed it was clear, but that was dumb of me.

I have a string - might be a tag name, might be a branch name, might be a SHA (complete or partial). I want to resolve that into a canonical SHA. My finger-memory is `git rev-parse`, but I can't say if that's just a bad habit I picked up somewhere...

Tim
On Sat, Aug 20, 2022 at 5:36 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
>
> Tim Hockin <thockin@google.com> writes:
>
> > Thanks.  Is there a more friendly way to do what I'm trying to
> > express?  Should I just use `rev-list -n1` instead?
>
> That's hard to answer, as you didn't exactly say what you are trying
> to express.  All you asked was: why is "--" treated as an arg.
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 8 in “rev-parse: -- is sometimes a flag and sometimes an arg?”
  1. Tim HockinAug 20, 2022
  2. Junio C HamanoAug 20, 2022
  3. Tim HockinAug 21, 2022
  4. Junio C HamanoAug 21, 2022
  5. Tim HockinAug 21, 2022
  6. Junio C HamanoAug 21, 2022
  7. brian m. carlsonAug 23, 2022
  8. Tim HockinAug 23, 2022

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.