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

Re: [PATCH] [BUG FIXED 2] git-add (-a|-u) and -n support

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Oct 14, 2007, 13:25 UTC
Message-ID
<vpq3awd25hs.fsf@bauges.imag.fr>
In-Reply-To
<E857D120-787F-460B-A167-4B5F4BD2C3B5@mit.edu>
Michael Witten <mfwitten@MIT.EDU> writes:
> Subject: [PATCH] git-add now understands two kinds of update:
>
>  	-u: update as before
>  	-a: update all as in a true 'git commit -a'
I don't find the option set very intuitive. I'd prefer
  - git add -u . => update the current directory as before
  - git add -u   => update all files from the root.

But your solution has the advantage of being backward compatible, so, no strong opinion here.

(side note: also, while you're here, it would be nice to have a single command to do "git add .; git add -u", i.e add all unknown files, update all existing files, and actally remove all deleted files. In one word, synchronize the index with the working tree completely. Perhaps "-a" would be a good name for that, not sure)

>  builtin-add.c |   69 +++++++++++++++++++++++++++++++++++++
> +-------------------

Your patch is whitespace-damaged. I don't know how to fix that for Apple Mail, but git-send-email can help.

>  static const char builtin_add_usage[] =
>  "git-add [-n] [-v] [-f] [--interactive | -i] [-u] [--refresh] [--]
> <filepattern>...";

You should document -a here, and in Documentation/git-add.txt if you introduce it.

-- 
Matthieu
Previous: Michael WittenNext: Michael Witten
Message 4 of 10 in “git-add (-a|-u) and -n support”
  1. git-add (-a|-u) and -n supportMichael Witten, Oct 14, 2007
  2. Michael WittenOct 14, 2007
  3. Michael WittenOct 14, 2007
  4. Matthieu MoyOct 14, 2007
  5. Michael WittenOct 14, 2007
  6. Karl HasselströmOct 15, 2007
  7. Michael WittenOct 15, 2007
  8. Johannes SchindelinOct 15, 2007
  9. Jeff KingOct 15, 2007
  10. Michael WittenOct 15, 2007

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.