threads / discuss / 653

git-diff-tree updates..

Subject: git-diff-tree updates..

## tl;dr

One message between May 18, 2005 and May 18, 2005.

replies: 0people: 1as markdown or json

Linus Torvalds· May 18, 2005, 20:28 UTC · lore

I've just fixed two annoyances of mine with git-diff-tree, which sadly caused me to break some syntax.

In particular, diff-tree for some unfathomable reason (probably incipient braindamage in yours truly) used a single dash "-" to mark the end of command line arguments, rather than the "--" that everybody else uses.

I hope nobody depended on it, because I fixed it.

The other thing I did was to allow a single SHA1, and then consider that to be equivalent to a one-line "--stdin" thing. Ie you can now do

	git-diff-tree -v -p HEAD
and it will do what you'd expect it to do, ie it should be equivalent to
	cat .git/HEAD | git-diff-tree -v -p --stdin
(apart from a silly bug which I'll fix shortly).

The latter means that if you actually want to track a _file_ named HEAD (or anything else that might trigger as a reference), you'd need to do

	git-rev-list HEAD | git-diff-tree -v -p --stdin -- HEAD

but I'm considering making the single-dash thing be equivalent to the combination "--stdin", and not allow SHA1 naming after it, so that this could be shortened to just be

	git-rev-list HEAD | git-diff-tree -v -p - HEAD
(but I wanted to make the "-" semantics change be a two-phase thing).
		Linus

← back to recent threads