Re: [PATCH] [BUG FIXED 2] git-add (-a|-u) and -n support
- From
Michael Witten <mfwitten@mit.edu>
- Date
- Oct 14, 2007, 22:00 UTC
- Message-ID
- <D44B7811-5A0F-4A31-9DB3-6D2BF645E543@MIT.EDU>
- In-Reply-To
- <vpq3awd25hs.fsf@bauges.imag.fr>
Thanks for the reply!
On 14 Oct 2007, at 9:25:03 AM, Matthieu Moy wrote:
Show 14 quoted lines
> 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.
Here's compromise that is backwards compatible. For both git-add and git-commit: -a dir [dir2 ...] => all changes in the given dirs. -a => all changes from the root.
Then we can just leave -u in place for now, and mark it as deprecated.
In any case, the goal is to make the intuition solid between git-commit and git-add.
Show 5 quoted lines
> (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)
We can couple the above with -f to do this.
Show 5 quoted lines
>> 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.
I see that now; Apple's trying to be smart about blank lines, it would seem.
Show 6 quoted lines
>> 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.
Let's get -a/-u squared away first.
Thanks again, Michael Witten