On Tue, 12 Feb 2008, Linus Torvalds wrote:
No it isn't. The above doesn't even work for bare repositories, or when
you want to look at a branch that has a different directory structure than
the currently-checked-out one.
.. and I don't mean that as a theoretical thing. I don't personally use
bare directories directly very much (I push to them, but I seldom do any
other remote management than just repacking once in a while), but it _is_
a meaningful operation for various services like gitweb or gitk etc.
Obviously gitweb doesn't support that --relative thing right now, and
maybe it never makes sense in that context, but it's actually really
pleasant how many things *do* just "automatically work" with bare
repositories etc.
So I simply don't think that we should assume a working directory for any
basic git operation, unless that operation fundamentally needs one because
it's only defined for a system with working directories (which is fairly
rare, but obviously happens: "git reset --hard", "git pull/merge", "git
checkout" etc).
Linus