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

Re: [PATCH] add: allow users to silence Git 2.0 warnings about "add -u"

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2013, 08:44 UTC
Message-ID
<7v621j8lmo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAJDDKr7F-wunjT_SS0mw+WUgoM3-Lu9bA3JUKk4sQiWWK0N9Jw@mail.gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 6 quoted lines
> I was originally concerned that "git add -u" was going to die()
> and we would no longer be able to use it without pathspec.
> My concerns were unfounded.
>
> (If I am not understanding this correctly then it is a sign
>  that the draft release notes can be made more clear)

Yes, that is exactly why I asked you to suggest improvements to that paragraph.

Show 8 quoted lines
>> Another problem with use2dot0 configuration is that it would invite
>> people to imagine that setting it to false will keep the old
>> behaviour forever, which is against what you set out to do with the
>> patch under discussion.
>
> I agree with both sides.  There's the part of me that wants the 2.0
> behavior now with a config switch for the same reasons as was
> discussed earlier...

If that is really the case and you want the full-tree behaviour, you would have been using "git add -u :/" already, and then you wouldn't have seen the warning.

Why do we have this thread then?

The reason may well be "I've heard about the :/ magic pathspec, and I thought I understood what it does at the intellectual level, but it has not sunk in enough for me to use it regularly".

The warning, and "you can squelch with either :/ or ." to train the fingers (not "set once and forget"), is exactly to solve that problem now *and* *in* *the* *future* during the 2.0 transition period.

You also said that it often is the case for you that you stay in a narrow subtree without touching other parts of the tree. If that is the case, you may *not* want 2.0 behaviour, which forces Git to run around the whole tree, trying to find modified paths outside of your corner that do not exist, wasting cycles. You want "git add .", and you are better off starting to train your fingers so that they type that without thinking now. I think the conclusion during the old discussion was not "we want configuration", but "this is not per user and configuration is a poor approach. Depending on what you are working on right now, you would want 'only here' sometimes and 'whole tree' some other times".

> We would never want to go back to the old behavior when 2.0
> roll around.  Jakub's "future.wholeTree" suggestion makes
> sense in that context as the entire "future.*" namespace
> could be designated as variables with these semantics.

Not at all. Even you who visit this list often do not regularly use the ":/" to affect the whole tree and see the warning. What do you imagine other people, who do not even know about this list do and say, at sites like stackoverflow where uninformeds guide other uninformeds?

  Q. Help, Git 1.8.2 is giving me this warning. What to do?
  A. Set this configuration variable. No other explanation.
Renaming use2dot0 to future does not solve anything.
> OTOH a positive thing about adding configuration to get
> the better behavior is that the code path materializes
> sooner, and it will be better exercised before 2.0.

That is not an argument for adding temporary configuration, as it is not the only or even the best way to do so. It can be easily an cleanly achieved by cooking in next until 2.0.

An ulterior motive for going that way is to encourage more people to run 'next' ;-). Recently we are seeing bugs discovered only after topics graduate to 'master', which is not a good sign X-<.

Previous: David AguilarNext: Junio C Hamano
Message 7 of 8 in “add: allow users to silence Git 2.0 warnings about "add -u"”
  1. add: allow users to silence Git 2.0 warnings about "add -u"David Aguilar, Feb 22, 2013
  2. Junio C HamanoFeb 22, 2013
  3. David AguilarFeb 22, 2013
  4. Matthieu MoyFeb 22, 2013
  5. Junio C HamanoFeb 22, 2013
  6. David AguilarFeb 23, 2013
  7. Junio C HamanoFeb 23, 2013
  8. Junio C HamanoFeb 22, 2013

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.