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

Re: Q about git rev-parse {--is-inside-work-tree, --show-cdup}

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
Dec 4, 2010, 15:12 UTC
Message-ID
<4CFA5A67.2020108@dirk.my1.cc>
In-Reply-To
<20101203215032.GB3972@sigill.intra.peff.net>
Am 03.12.2010 22:50 schrieb Jeff King:
Show 13 quoted lines
> On Fri, Dec 03, 2010 at 01:25:36PM -0800, Junio C Hamano wrote:
>
>> That would break existing scripts that expect "-q" to squelch only the
>> error output, no?  I think the risk of breaking existing scripts that
>> other people wrote over time that you (and I) haven't seen outweighs any
>> benefit (i.e. "if test $(rev-parse...) = true" vs "if rev-parse...") you
>> are seeing here.
>
> Right now "-q" doesn't do _anything_ for --is-inside-work-tree, AFAICT.
> It is a useless no-op. So I don't know if we are breaking anybody. What
> does somebody doing "git rev-parse -q --is-inside-work-tree" expect to
> happen?
>
Peff, Junio, thanks for your answers.

I already had a suspicion that changing plumbing tools like rev-parse was a bad idea. You confirmed that. However, I still think it's a little bug that "--show-dup" returns an empty string instead of a dot when already in topdir. But it's too late to change that, I guess. I didn't know about Peff's suggestions "git-sh-setup" and "--show-toplevel". They may help me.

@Peff, right, it's annoying that -q sometimes works and sometimes doesn't. To my opinion switches like --quiet and --verbose should _always_ work.

     Dirk
Previous: Jeff KingNext: Andreas Schwab
Message 5 of 6 in “Q about git rev-parse {--is-inside-work-tree, --show-cdup}”
  1. Dirk SüsserottDec 3, 2010
  2. Jeff KingDec 3, 2010
  3. Junio C HamanoDec 3, 2010
  4. Jeff KingDec 3, 2010
  5. Dirk SüsserottDec 4, 2010
  6. Andreas SchwabDec 4, 2010

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.