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

Re: Weird behavior of git rev-parse

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 14, 2009, 11:34 UTC
Message-ID
<m3iqhvv6ph.fsf@localhost.localdomain>
In-Reply-To
<7vvdlvhbtg.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 23 quoted lines
> Yakup Akbay <yakbay@ubicom.com> writes:
> 
> > Then I've tried
> >
> >    $ git rev-parse -'hi, this is a test!'
> >
> > the output is:
> >
> >    -hi, this is a test!
> >
> > Is this an expected behavior?
> 
> Absolutely.  rev-parse was originally written as a way for Porcelain
> scripts to sift parameters into four different categories.
> 
>  * options and non-options (that's two)
> 
>  * args meant for rev-list and others (that's another two)
> 
> Multiplying two x two gives you four combinations.
> 
> Because you are not giving options like --revs-only, --no-revs, --flags,
> nor --no-flags, rev-parse outputs everything.
git-rev-parse can also be used to bring parseopt to shell scripts.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Yakup Akbay
Message 5 of 5 in “Weird behavior of git rev-parse”
  1. Yakup AkbayJul 14, 2009
  2. Santi BéjarJul 14, 2009
  3. Junio C HamanoJul 14, 2009
  4. Yakup AkbayJul 14, 2009
  5. Jakub NarebskiJul 14, 2009

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.