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

Re: [PATCH 1.8.0] add: make "add -u" update full tree without pathspec

From
Jeff King <peff@peff.net>
Date
Mar 1, 2011, 20:00 UTC
Message-ID
<20110301200025.GF10082@sigill.intra.peff.net>
In-Reply-To
<vpq4o7mfzd1.fsf@bauges.imag.fr>
On Tue, Mar 01, 2011 at 07:51:38PM +0100, Matthieu Moy wrote:
Show 12 quoted lines
> > Once your users (you as a script writer) have an option to set the
> > configuration to participate in the tree-wide party early, you would need
> > to update your scripts immediately so that they don't break on them;
> 
> But "update" should mean "replace git add -u with git add -u .", which
> is the portable way to do the same.
> 
> > so the introduction of the configuration becomes a flag-day event.
> > Hmph...
> 
> The introduction of the config variable is a non-event if you already
> use the portable . notation.

Right. Once this happens, you can never say "git add -u" again portably. You can't rely on the old behavior, because it's changing. You can't rely on the new behavior, because you might be using an old version. So as a script you _must_ say "git add -u .", and if you want top-level behavior and are not at the top-level, you must cd to the toplevel and "add .". Which sounds onerous, but it is what scripts have to do already with the current behavior.

Show 10 quoted lines
> > Yeah, I think you convinced me that an elaborate configuration wouldn't
> > help us at all.  We just keep warning in 1.7.x series when "add -u" didn't
> > see any pathspec, and flip the default at 1.8.0
> >
> > Simpler and cleaner ;-)
> 
> I think is still makes sense to have a config variable, so that people
> who want the new behavior can get it ASAP. Right after 1.8 is out, I'll
> still have machines where I'm too lazy to install a brand new Git, and
> I'll want to get the 1.8 goodness for free ;-).

Agreed. I also think there should be a setting to keep the current behavior. I don't want to use it, but given that configuration does not introduce any existing portability issues, we can help people who really liked the old behavior. We are inconveniencing them by changing the default, but it seems doubly mean to leave them with no way of restoring it short of typing extra characters on every invocation.

-Peff
Previous: Jakub NarebskiNext: Junio C Hamano
Message 23 of 25 in “add: make "add -u" update full tree without pathspec”
  1. add: make "add -u" update full tree without pathspecNguyễn Thái Ngọc Duy, Feb 7, 2011
  2. Junio C HamanoFeb 7, 2011
  3. Nguyen Thai Ngoc DuyFeb 7, 2011
  4. Miles BaderFeb 7, 2011
  5. Joshua JuranFeb 9, 2011
  6. Matthieu MoyFeb 7, 2011
  7. Junio C HamanoFeb 27, 2011
  8. Matthieu MoyFeb 27, 2011
  9. Nguyen Thai Ngoc DuyFeb 27, 2011
  10. Sverre RabbelierFeb 27, 2011
  11. Nguyen Thai Ngoc DuyFeb 27, 2011
  12. Nguyen Thai Ngoc DuyFeb 27, 2011
  13. Junio C HamanoFeb 27, 2011
  14. Nguyen Thai Ngoc DuyFeb 28, 2011
  15. Junio C HamanoFeb 28, 2011
  16. Nguyen Thai Ngoc DuyMar 1, 2011
  17. Junio C HamanoMar 1, 2011
  18. Nguyen Thai Ngoc DuyMar 1, 2011
  19. Matthieu MoyMar 1, 2011
  20. Junio C HamanoMar 1, 2011
  21. Matthieu MoyMar 1, 2011
  22. Jakub NarebskiMar 1, 2011
  23. Jeff KingMar 1, 2011
  24. Junio C HamanoMar 1, 2011
  25. Matthieu MoyMar 1, 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.