Re: [PATCH] make 'git add' a first class user friendly interface to the index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Carl Worth <cworth@xxxxxxxxxx> writes:

>> > +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.

>> 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.


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]