Re: Q about git rev-parse {--is-inside-work-tree, --show-cdup}
- From
- Dirk 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