Re: git rev-parse --show-toplevel inside `.git` returns 0 and prints nothing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 18, 2019 at 08:13:02PM -0800, Anthony Sottile wrote:

> > I think the reason this hasn't come up until now is callers are expected
> > to use require_work_tree() or "rev-parse --is-inside-work-tree" first.
> >
> > It would probably make sense for the rev-parse documentation to also
> > clarify what "the top-level directory" is.
> >
> > -Peff
> 
> I realize I forgot to include the X to my Y :) -- this was a totally
> silly case that I got as a bug report:
> https://github.com/pre-commit/pre-commit/issues/1219
> 
> I *expected* an error case but didn't get one

Yes, and I do agree that an error is the right thing.

Would that have helped your pre-commit script? I guess it would have
barfed at that point. :) It sounds like it should be checking first that
it has a working tree.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux