From: Drew Northup Date: Thu, 21 Oct 2010 20:06:42 GMT Subject: Re: Git terminology: remote, add, track, stage, etc. Message-ID: <1287691602.24161.67.camel@drew-northup.unet.maine.edu> In-Reply-To: On Thu, 2010-10-21 at 16:06 +0200, Thore Husfeldt wrote: > On 21 Oct 2010, at 14:56, Drew Northup wrote: > > > That's not what I asked. > > [... good, concrete example omitted...] > > > > $ vim A.txt > > $ git stage A.txt > > $ git commit > > $ vim C.txt > > $ vim A.txt > > $ git stage A.txt > > $ git stage C.txt > > > > Should the last two commands fail? > > No, not for me. (Is this in reaction to Jakub’s suggestion that an > “untracked file”, like C.txt, cannot be staged before explicitly > tracked?) I hadn't read any of his comments to mean that, but I could be missing something... More than anything else I was trying to feel out possible workflow issues. A lot of people are going to (continue? to) confuse "git add" and "svn add" if we don't make very explicit what we are up to. As you are not suggesting we outright replace "git add" I wanted to be very sure as to what you mean to do. > Maybe this is what should happen: > > $ git stage C.txt > git stage: Contents of previously untracked file C.txt staged for next commit This is reasonable. I would probably say "...untracked file C.txt added to index and staged for next commit" to emphasize the existing "git add" idiom, but that may be superfluous. > > Now, if "git stage" were an outright replacement for "git add" > > there might be more use (but I'd still not be happy about the corruption > > of the idiom). > > I tend to agree. But look at, e.g., Figure 2.1 in the Pro Git book > http://progit.org/book/ch2-2.html . That view strongly enforces that > something special happens to the new “pink” file, different from what > happens to a “yellow” file. After this helpful discussion, I don’t > like figure 2.1 so much anymore. A red arrow should go from “pink” to > “blue” with text “stage the file”. I can see why this would get your attention. I have to admit I ignored it because it didn't match-up with the bulk of documentation in any way I had yet made sense of. Once I had made sense of the idiom and looked back at the graphic I shrugged and wondered why the author had chosen to illustrate it that way. -- -Drew Northup N1XIM AKA RvnPhnx on OPN ________________________________________________ "As opposed to vegetable or mineral error?" -John Pescatore, SANS NewsBites Vol. 12 Num. 59