If both cases of checking out a path you are expected to provide a <tree-ish>, 
not a <branch>. The git glossary says that a tree-ish is a commit, tree, or tag 
- nothing about a branch.  The corner case is probably hidden inside that 
aspect of the wording. 

If you can think of a succinct phrase that would clarify the situation, that 
fits a 'man page' style, and blends into the current man page, then it could be 
worth sending in a patch to the main mailing list g...@vger.kernel.org (plain 
text format!)

Philip
  ----- Original Message ----- 
  From: Senthil 
  To: git-users@googlegroups.com 
  Sent: Tuesday, September 04, 2012 6:21 PM
  Subject: [git-users] git checkout <file>" silently fails


  This may be an edge case which has been discussed, but I did not find any 
topics relating to this.
  If file 1 exists on branch B but not on branch A, I am seeing this behavior:
  git checkout A
  git checkout A -- 1
  error: pathspec '1' did not match any file(s) known to git.
  git checkout B
  git checkout A -- 1
  No complaints after running the last line the second time around. The file 
exists in the directory tree, and it is the version that exists in branch B. 
How come the second time, git does not throw an error message and just silently 
does nothing?
  I'm using GIT version 1.7.4.1
  Thanks,
  -Senthil

  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/GOBlhTU5-cwJ.
  To post to this group, send email to git-users@googlegroups.com.
  To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2012.0.2197 / Virus Database: 2437/5248 - Release Date: 09/04/12

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to