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

Re: [PATCH 2/4] add -u: get rid of "treewideupdate" configuration

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2011, 19:27 UTC
Message-ID
<7vaag04k8m.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110408175149.GA3917@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
>> What remains is the downside of the configuration variable,
>> namely, that it makes git behave differently depending on who you are and
>> in which repository you are using it, hence making it harder to help
>> and/or teach others.
>
> I have never been a fan of this reasoning. Sure, it is slightly harder
> to help people when the system is configurable. But dropping
> configurability comes at the cost of people who are using the system
> day-to-day. And isn't making it pleasant to use every day more important
> than the minority of times you are telling somebody else how to use it?

I probably should stated it differently. I dropped it during this round because they are _not_ needed to help the transition, but it is a possible additional feature.

Let me try to explain the train of throught a bit better.

People seem to expect "add -u" without any pathspec to work on the whole working tree structure even when you are in a subdirectory, similar to "git commit -a". We will be changing "add -u" in the longer term to do so.

After the transition happens, people can easily say "add -u ." to limit it to the current subdirectory, and people can say "add -u ." even today to be explicit (which would help them transitioning).

Before the transition, however, there is no pleasant way to cause "add -u" to add everything when you work in a subdirectory, short of saying:

	(cd $(git rev-parse --show-cdup)/. && git add -u)

With ":/", we gain an easy way, "git add -u :/", to say "whole tree". That is the only thing this series does.

Up to this part, I think we both agree are good thing.

Now, imagine you were born in a world where we had the :/ magic from day one of git. Different commands "git add -u", "git grep", "git ls-files" without pathspec operate differently, and for some reason (e.g. usability, similarity to other people's corresponding command, or historical reasons) some of them operate only within the current subdirectory while others operate on the whole tree. The default behaviour might even be different between versions of git or user configuration.

Because we assume that you already have both "." and ":/" to easily be explicit in that world, "teachers and helpers may have to scratch there head wasting their time" is no longer an issue. If you are teaching others, you ought to know about "." and ":/", and whether we add the configuration mechanism or not, you ought to know that you should be explicit to protect yourself from the differences between 1.7.X and 1.8.0 versions in the first place.

So I agree that "costs teachers and helpers" is much less of an issue.

You can certainly introduce configuration variables e.g. "addu.treewide", "grep.treewide", "lsfiles.treewide" (or even "core.treewide" to cover them all) to change the default behaviour for each user or each repository.

The real question would become: if it is worth the maintenance cost of additional code to help users who want to avoid typing "." (or ":/") all the time in the environment they control. I don't know the answer to this question yet.

A good new is that we had to conflate the discussion with "but there is no pleasant way to tell 'default to local' commands to work on the whole tree" justification for configuration variables before ":/". With ":/", that excuse will be gone and the discussion can be much more simplified.

Previous: Jeff KingNext: Jeff King
Message 16 of 35 in “Redoing the "add -u" migration plan”
  1. 0/4 Redoing the "add -u" migration planJunio C Hamano, Apr 7, 2011
  2. 1/4 magic pathspec: add tentative ":/path/from/top/level" pathspec supportJunio C Hamano, Apr 7, 2011
  3. Junio C HamanoApr 7, 2011
  4. Nguyen Thai Ngoc DuyApr 7, 2011
  5. Junio C HamanoApr 7, 2011
  6. Nguyen Thai Ngoc DuyApr 8, 2011
  7. Nguyen Thai Ngoc DuyApr 7, 2011
  8. Junio C HamanoApr 7, 2011
  9. Nguyen Thai Ngoc DuyApr 8, 2011
  10. Junio C HamanoApr 8, 2011
  11. Nguyen Thai Ngoc DuyApr 8, 2011
  12. Junio C HamanoApr 8, 2011
  13. Nguyen Thai Ngoc DuyApr 8, 2011
  14. 2/4 add -u: get rid of "treewideupdate" configurationJunio C Hamano, Apr 7, 2011
  15. Jeff KingApr 8, 2011
  16. Junio C HamanoApr 8, 2011
  17. Jeff KingApr 8, 2011
  18. Junio C HamanoApr 8, 2011
  19. Jeff KingApr 8, 2011
  20. Junio C HamanoApr 8, 2011
  21. Junio C HamanoApr 8, 2011
  22. Nguyen Thai Ngoc DuyApr 9, 2011
  23. Junio C HamanoApr 9, 2011
  24. Nguyen Thai Ngoc DuyApr 9, 2011
  25. Junio C HamanoApr 9, 2011
  26. Nguyen Thai Ngoc DuyApr 9, 2011
  27. Junio C HamanoApr 9, 2011
  28. Nguyen Thai Ngoc DuyApr 9, 2011
  29. Nguyen Thai Ngoc DuyApr 9, 2011
  30. Junio C HamanoApr 9, 2011
  31. Nguyen Thai Ngoc DuyMay 3, 2011
  32. Junio C HamanoMay 3, 2011
  33. Nguyen Thai Ngoc DuyMay 3, 2011
  34. 3/4 add: make "add -u/-A" update full tree without pathspec (step 2)Junio C Hamano, Apr 7, 2011
  35. 4/4 add: make "add -u/-A" update full tree without pathspec (step 3)Junio C Hamano, Apr 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.