On Thu, 11 Jun 2009, Felipe Contreras wrote: > On Wed, Jun 10, 2009 at 7:03 AM, Linus > Torvalds<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > > > > > On Tue, 9 Jun 2009, Theodore Tso wrote: > >> > >> My personal opinion is this kind of overloading is actually more > >> confusing than simply adding a new name, such as "git revert-file". > > > > I'd agree, except I think it actually worked pretty well in "git > > checkout". > > > > The alternative was to add yet another command for that, or to teach > > people about the internal commands we did have. Adding the capability for > > checkout to check out individual files - in addition to commits and > > branches - I think worked pretty well. > > Why? What makes 'git checkout <commit>' and 'git checkout <commit> -- > <path>' similar at all? I would expect 'git checkout <commit>' to be > the same as 'git checkout <commit> -- .' You don't understand. "git checkout" would be similar to "git revert", if we did that change. IOW, both would be "if you give it a commit, it acts at a commit level", and "if you give it pathnames, it acts on a pathname level". That is totally obvious, and not in the least confusing. They are two different things, but at the same time, there is no question about which is which. > In my mind these are 2 completely different commands. They are two different things, but they both make sense within the _context_. Only earthworms and FOX news have no concept of "in context". So it does make sense to say "git checkout filename" (and expect it to check out that _filename_ - surprise surprise), and also say "git checkout branch" (and expect it to check out that branch - again, big surprise). Humans are generally _very_ good at seeing the same word in two different contexts, and not being confused at all. There is no confusion when I talk about SCM's in the context of git, even though "SCM" could also mean a Sceme interpreter, or "Saskatchewan College of Midwives". In fact, it is often *much* better to accept context-awareness, than to try too hard to be "uniquely identifying" even without context. Of course, you do want things to also be unambiguous. But that's why we have things like that "--" thing, when we want to specify pathspecs explicitly and don't want to accept any kind of ambiguity. Most humans tend to leave them out, and that "--" thing shows up mostly in git scripts. Linus -- 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