Re: rev-parse: -- is sometimes a flag and sometimes an arg?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 21, 2022, 00:54 UTC
- Message-ID
- <xmqqzgfyh0vj.fsf@gitster.g>
- In-Reply-To
- <CAO_RewaZHL34WBaoXVyXh6ZNVuG+fi5uGUbpRMsc9N=orHzx1Q@mail.gmail.com>
Tim Hockin <thockin@google.com> writes:
Show 5 quoted lines
> 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.
"git rev-parse --verify string" would insist that 'string' is an object name and show it as an object name to the standard output, or gives an error message and exits with a non-zero status.
"git rev-parse --help" has some more elaborate examples in its EXAMPLES section.