git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-diff-tree updates..

From
Linus Torvalds <torvalds@osdl.org>
Date
May 18, 2005, 20:28 UTC
Message-ID
<Pine.LNX.4.58.0505181316330.18337@ppc970.osdl.org>

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
Message 1 of 1 in “git-diff-tree updates..”
  1. Linus TorvaldsMay 18, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.