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
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2011, 10:46 UTC
Message-ID
<7vei6t4uwa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1297045643-26697-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 5 quoted lines
> Migration plan:
>
> I'm bad at this. Can we start with a patch that warns users to do "git
> add -u ." when they do "git add -u"? Hopefully they would have their
> fingers retraied by the time the behavior is changed in 1.8.0.
Perhaps in this order:
Step 1, as soon as possible:
 * Introduce "static int make_update_global;" file scope static to
   builtin/add.c and default to 0;
 * Introduce "add.make_update_global" configuration variable, and toggle
   the above variable when it is explicitly given; also record the fact
   that you actually saw this variable in the config parser regardless of
   the value that is given;
 * Document the configuration variable as a new feature, without
   indicating that that will be the new default in the future, but
   strongly recommending that existing scripts should be updated and new
   scripts should be written the variable in mind---namely, their use of
   "add -u" should use "." if they are relying on the current "limit to
   cwd" behaviour.
 * Ship this as 1.7.X and see how well the new feature is accepted in the
   wider user community.  If the feature is not widely used, there is no
   point in proceeding further.

Step 2, two cycles (i.e. 6-8 months) before 1.8.0, provided if the previous step is proven positive:

 * When "git add -u" is run without any pathspec, and when the user does
   not have the configuration variable, warn loudly that the default
   behaviour will change in 1.8.0, and tell the users that the current
   behaviour is still available by setting the configuration variable.
Step 3, at 1.8.0 and probably one or two more cycles:
 * When "git add -u" is run without any pathspec, and when the user does
   not have the configuration variable, warn loudly that the default
   behaviour _has_ changed in 1.8.0, to help people who migrated from
   early 1.7.X before Step 2 directly to 1.8.X series.
Step 4, 3 cycles after 1.8.0:
 * Drop the warning.
> PS. What about -A?

I personally think it should change exactly the same way as "-u" for consistency, but I had the impression that the list concensus was to keep the current behaviour.

Has anybody been keeping tallies on the discussion around
  http://thread.gmane.org/gmane.comp.version-control.git/166135/focus=166457

We seem to have lost track. All I recall was that I changed my mind and migrated from the third camp (the command defaults to whichever somebody thought would be more convenient, lacking consistency across command set) to "it would be more convenient to default to full-tree when there is no pathspec, as limiting to cwd with '.' is easier" camp myself, but the discussion is not about my personal preference but about seeing if we have an overwhelming majority consensus, so...

Previous: Matthieu MoyNext: Matthieu Moy
Message 7 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.