News for hackers. Stuff that matters.
Re:Legit. Git for humans by djacobs on Sunday March 25, 2012 @04:50PM (#3753776)
Git checkout is actually pretty consistent and only really works on branches. When you say it works on files, you actually mean it has a shorthand that works on files:

  git checkout my-file
... is actually using a lot of smart defaults. Namely, you're actually running ...

  git checkout HEAD -- my-file
If you don't specify a branch or identifier, git uses HEAD by default in most cases. (When you run git diff other-branch, you're actually running git diff HEAD other-branch.) And the dash-dash syntax is mostly optional in modern git.

Not inconsistent at all, as far as I can tell. In fact, most features of git that I use on a regular basis are completely consistent and orthogonal. The exceptions are submodules and remote cache branches...

Re:Legit. Git for humans by gcb on Sunday March 25, 2012 @07:28PM (#3754216)
So, in the end it worked on a file. :-)
Re:Legit. Git for humans by djacobs on Sunday March 25, 2012 @08:51PM (#3754414)
It worked on a branch, filtered by a file name. I think that's an important distinction. That distinction unifies the definition of `git checkout`.
Re:Legit. Git for humans by adamc on Monday March 26, 2012 @09:17AM (#3756496)
But

But it doesn't lead to an obvious, consistent command syntax, and that was the point.

Re:Legit. Git for humans by djacobs on Monday March 26, 2012 @12:06PM (#3757288)
It's a consistent syntax with smart defaults you can leave out. You wouldn't say Unix's wc is inconsistent, would you, just because it has default behavior?
Re:Legit. Git for humans by phillmv on Monday March 26, 2012 @12:53PM (#3757530)
Apples to Oranges. wc is a bad example.

Better example is tar vs cp, where you go

  cp files you want to copy destination/
and

  tar destination.tar files you want to archive
And yes, I would say that's inconsistent.
Re:Legit. Git for humans by gcb on Monday March 26, 2012 @06:06PM (#3758885)
hum... both are wrong.

wc is "word count" it's not a sane default. it's a obviously explicitly behavior. if git checkout were called 'git checkbranch' then you would have a point.

tar does not have sane defaults. it requires explicit flags. your example (besides not working because as i said, it does not have defaults) could very well be `tar -c files you want to copy -f destination.tar` and all would be well. you actually still repeat the very first tar command line example you ever saw to this day, even not agreeing with it :)