Re: Git terminology: remote, add, track, stage, etc.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Haggerty
Date: Thursday, October 21, 2010 - 1:44 am

On 10/18/2010 11:57 PM, Jakub Narebski wrote:

I think that is a great idea.  The thing that I found most confusing
when learning git is that variations on a single command often have very
different effects.  My pet peeve is the over-versatile "git checkout":

git checkout BRANCH : Check out a branch.  This is the functionality
that I would expect from a "checkout" command.

git checkout -b NEWBRANCH OLDBRANCH : For me this was unintuitive,
because (IMO) the main effect of the command is to create a new branch.
 (I consider that more significant than the checkout because it has a
persistent effect on the repository.)  Therefore, I would expect this
functionality to be provided by "git branch" (something like "git branch
--checkout NEWBRANCH OLDBRANCH").

git checkout -b NEWBRANCH : This is even more unintuitive, because no
content is being checked out at all.  This should be written "git branch
--checkout NEWBRANCH".

git checkout -- PATH : To me this is again a totally different
operation.  The other uses of "git checkout" are safe; they don't lose
any information.  But this usage discards the working copy changes
irretrievably.  Such a different operation deserves a different command
with a "dangerous-sounding" name.  I think this functionality should be
made more easily accessible via "git reset", as has been suggested
elsewhere on this thread.  (Unfortunately "git revert" is already taken.)

git checkout BRANCH -- PATH : This is even more perverse.  Usually
"check out" makes the working copy more similar to a version in the
repository.  But this command makes it more different.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Mon Oct 18, 1:45 pm)
Re: Git terminology: remote, add, track, stage, etc., Jonathan Nieder, (Mon Oct 18, 2:15 pm)
Re: Git terminology: remote, add, track, stage, etc., Sverre Rabbelier, (Mon Oct 18, 2:35 pm)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Mon Oct 18, 2:41 pm)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Mon Oct 18, 2:57 pm)
Re: Git terminology: remote, add, track, stage, etc., Junio C Hamano, (Mon Oct 18, 5:03 pm)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Mon Oct 18, 9:49 pm)
Re: Git terminology: remote, add, track, stage, etc., Wincent Colaiuta, (Tue Oct 19, 12:19 am)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Tue Oct 19, 12:48 am)
Re: Git terminology: remote, add, track, stage, etc., Wincent Colaiuta, (Tue Oct 19, 1:05 am)
Re: Git terminology: remote, add, track, stage, etc., Matthijs Kooijman, (Tue Oct 19, 1:05 am)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Tue Oct 19, 1:27 am)
[PATCH v3] Porcelain scripts: Rewrite cryptic "needs updat ..., Ramkumar Ramachandra, (Tue Oct 19, 7:39 am)
Re: Git terminology: remote, add, track, stage, etc., Eugene Sajine, (Tue Oct 19, 8:09 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Tue Oct 19, 10:30 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Tue Oct 19, 10:51 am)
Re: Git terminology: remote, add, track, stage, etc., Jonathan Nieder, (Tue Oct 19, 11:28 am)
Re: Git terminology: remote, add, track, stage, etc., Sverre Rabbelier, (Tue Oct 19, 11:34 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Tue Oct 19, 11:43 am)
Re: Git terminology: remote, add, track, stage, etc., Nicolas Pitre, (Tue Oct 19, 12:15 pm)
Re: Git terminology: remote, add, track, stage, etc., Junio C Hamano, (Tue Oct 19, 12:20 pm)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Tue Oct 19, 1:57 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Tue Oct 19, 2:53 pm)
[RFC/PATCH 0/4] reset: be more flexible about <rev>, Jonathan Nieder, (Tue Oct 19, 3:10 pm)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Wed Oct 20, 2:53 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Wed Oct 20, 4:34 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Wed Oct 20, 7:01 am)
Re: Git terminology: remote, add, track, stage, etc., Michael Haggerty, (Thu Oct 21, 1:44 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 4:20 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Thu Oct 21, 5:31 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 5:56 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Thu Oct 21, 7:06 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 1:06 pm)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Thu Oct 21, 9:07 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Fri Oct 22, 4:51 am)
Re: Git terminology: remote, add, track, stage, etc., Paul Bolle, (Fri Oct 22, 1:16 pm)
Re: Git terminology: remote, add, track, stage, etc., Eugene Sajine, (Fri Oct 22, 2:00 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Fri Oct 22, 2:46 pm)
Re: [PATCH v3] Porcelain scripts: Rewrite cryptic "needs u ..., Ramkumar Ramachandra, (Wed Oct 27, 7:55 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Wed Oct 27, 8:03 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Wed Oct 27, 8:16 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Wed Oct 27, 9:08 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Thu Oct 28, 8:20 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Thu Oct 28, 11:25 am)