Thread (7 messages) flat view 7 messages, 5 authors, 2016-06-15

Re: "git add -u" broken in git 1.7.4?

From: Jeff King <hidden>
Date: 2016-06-15 22:50:31

On Sun, Feb 06, 2011 at 10:46:20PM -0800, Junio C Hamano wrote:
I actually do not mind too much myself if all commands that can take
pathspecs consistently defaulted to "full-tree" pathspec given no
pathspec.  But if we were to go that route, everybody should join their
voice to defend that decision when outside people say "in 1.8.0 'git grep'
run from a subdirectory shows matches from all the irrelevant parts of the
tree; with all the cruft its output is unreadable". I won't be the sole
champion of such a behaviour when I do not fully believe in it.
The problem is that I don't feel comfortable writing an RFC that says
"in 1.8.0 we will default to full-tree because it is somehow better".
Because I don't think it is better; it is simply a different way of
thinking about it, and different people will have different preferences.

I think even the same people may different preferences from project to
project. For most of my projects, the scope of the repo is well-defined,
and I want full-tree semantics (e.g., I hack on a bug, go into t/ to
tweak and run the tests, and then want to "git add -u" the whole thing
when everything looks good). But I also recently worked on a gigantic
project that was split into several sub-components. I would cd 3 or 4
levels deep into the sub-component that I was working on, and I would
prefer my "git add -u" to stay in that sub-component, and my "git grep"
to look only in that sub-component.

Which implies to me that the "relative" or "full-tree" view should be a
per-repo configurable thing. But that introduces its own set of
headaches, as people may script around things like "git add", and it
would become predictable to do so only from the top-level of the working
tree.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help