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

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

From
Jeff King <peff@peff.net>
Date
Feb 7, 2011, 19:50 UTC
Message-ID
<20110207195035.GA13461@sigill.intra.peff.net>
In-Reply-To
<7vhbcguytf.fsf@alter.siamese.dyndns.org>
On Sun, Feb 06, 2011 at 10:46:20PM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> 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
Previous: Junio C HamanoNext: SZEDER Gábor
Message 13 of 34 in “"git add -u" broken in git 1.7.4?”
  1. Sebastian PippingFeb 6, 2011
  2. Jeff KingFeb 6, 2011
  3. Sebastian PippingFeb 6, 2011
  4. Matthieu MoyFeb 6, 2011
  5. SZEDER GáborFeb 6, 2011
  6. Sebastian PippingFeb 6, 2011
  7. Junio C HamanoFeb 7, 2011
  8. Jeff KingFeb 7, 2011
  9. Junio C HamanoFeb 7, 2011
  10. Nguyen Thai Ngoc DuyFeb 7, 2011
  11. SZEDER GáborFeb 7, 2011
  12. Junio C HamanoFeb 7, 2011
  13. Jeff KingFeb 7, 2011
  14. SZEDER GáborFeb 8, 2011
  15. Jeff KingFeb 9, 2011
  16. Junio C HamanoFeb 9, 2011
  17. Jeff KingFeb 9, 2011
  18. Nguyen Thai Ngoc DuyFeb 10, 2011
  19. Jeff KingFeb 10, 2011
  20. Junio C HamanoFeb 10, 2011
  21. Johannes SixtFeb 10, 2011
  22. Joshua JuranFeb 10, 2011
  23. Matthieu MoyFeb 10, 2011
  24. command-list.txt: mark git-archive plumbingNguyen Thai Ngoc Duy, Feb 15, 2011
  25. Junio C HamanoFeb 15, 2011
  26. Nguyen Thai Ngoc DuyFeb 16, 2011
  27. Matthieu MoyFeb 7, 2011
  28. Jeff KingFeb 7, 2011
  29. Junio C HamanoFeb 7, 2011
  30. Eric RaibleFeb 8, 2011
  31. Junio C HamanoFeb 8, 2011
  32. Matthieu MoyFeb 7, 2011
  33. Michael J GruberFeb 7, 2011
  34. SZEDER GáborFeb 7, 2011

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.