Re: [PATCH] make 'git add' a first class user friendly interface to the index
- From
Junio C Hamano <junkio@cox.net>
- Date
- Dec 2, 2006, 07:54 UTC
- Message-ID
- <7vlklq20n5.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <87veku3i0j.wl%cworth@cworth.org>
Carl Worth <cworth@cworth.org> writes:
Show 7 quoted lines
>> > +Contrary to other SCMs, with GIT you have to explicitly "add" all the >> > +changed file content you want to commit together to form a changeset >> > +with the 'add' command before using the 'commit' command. > > I think we can explain the git model in positive terms that stand on > its own. People will learn the differences and appreciate how git is > better. So I'd just drop "Contrary to other SCMs".
I already committed Nico's on 'master', because all he said in his response made sense, but this comment made me rewind it. I agree that we do not have to start with a "we are harder to learn, we are different from what you know, you have been warned." I'll queue it for 'next'.
> Wow, this index stuff sure takes a lot of explaining. Why are users > better off having to grasp all of that stuff before they can > successfully add; edit; #oops, add again; and commit their files?
Jumping the index is not about that sequence. It is about being interrupted while doing something else, and committing a smaller trivial change first that is independent from what you have been doing. Beginners do not have to do that "interrupted work" sequence.
Show 8 quoted lines
>> I wonder if this sequence should do the same as "git rm -f foo": >> >> $ /bin/rm foo >> $ git add foo > > Argh. Please no. Update-index already exists. Let's not push all of > its semantics onto "add". Let's use "add" for when the user _actually_ > wants to _add_ a file. Please? please?
I do agree "adding the deletion" is a funny terminology. But this is a illustration that this part of proposed update to the tutorial could be further improved:
+But for instance it is best to only remember 'git add' + 'git commit' +and/or 'git commit -a'. + +No special command is required when removing a file; just remove it, +then tell `commit` about the file as usual.
We say "you should add modified state again if you edit it again after you added it" in a section before these sentences, and encourage users to consistently say 'git add'. Since we supply "git rm" and "git mv" to make it convenient to remove/rename files and index entries at the same time, I think it would be better to say "Use add/rm/mv", not "don't worry about rm".
By the way, aren't people disturbed that "git rm" does not default to "-f" -- I rarely use the command myself but that makes it feel even more awkward that "git rm foo" does not remove the file "foo".
> PS. Is there a twelve-steps program for people who can't let a thread > die? I really want to stop, and I keep telling myself I can stop > anytime I want.
Well, I think at least we are converging.