On 04/11/2011 02:53 PM, Dave Cohen wrote:
I suppose if you're a fan of git, you can argue that it is always right.
I'm no more a"fan" of git than i am of drupal. Its a tool that has good
value if you know how to use it and can frustrate the hell out of you if
you dont.
If you're like me, on the other hand, you might expect something to show up in
git diff, after you've run git add.
It just has one more layer of intelligence/workflow that allows it/you
to ignore changes in your working copy that you don't want to pay
attention right now. If you're like me and have a couple things going on
at once and want to commit your work in atomic chunks you can find it
useful. If not there are git shortcuts for commits to ignore the whole
layer.
To do what you want above, just temporarily tell git to care about your
new files with "git add ." or listing them by name and then run "git
diff HEAD".
I find that "git diff HEAD" is wrong because I'm not working on HEAD. Similarly,
"git diff origin" does not do the right thing.
You find that its wrong or it doesnt work? These are two different things.
HEAD is a special dynamic variable that refers to the most recent commit
in the index. It is there so you don't have to type in the whole commits
crazy ass SHA name. In that way it works EXACTLY like a named version
tag. (fyi HEAD^ equals "next to last commit" so git "diff HEAD^ HEAD"
shows you the diff between the last commit and the one before it).
You can see what this is by interrogating the HEAD file in .git manually
for fun. HEAD isnt a branch name like master or |6.x-3.x. Though i can
see the point of confusion if im understanding you correctly.
|
--
Michael Favia [email protected]
tel. 512.669.5650 http://www.favish.com