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

Re: Improve handling of "." and ".." in git-diff-*

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 17, 2005, 03:52 UTC
Message-ID
<Pine.LNX.4.58.0508162044390.3553@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0508162037080.3553@g5.osdl.org>
On Tue, 16 Aug 2005, Linus Torvalds wrote:
> 
> This fixes up usage of ".." (without an ending slash) and "." (with or 
> without the ending slash) in the git diff family.
Btw, if it wasn't clear, with this patch you can now do
	git diff .

and it will show the diffs for everything under the current working directory. Similarly, you can do

	git diff ./drivers
or something like
	cd arch/i386
	git diff . ../x86-64 

and it will do the obvious thing (the "obvious thing" in the latter case is to show the diffs for everything under _both_ arch/i386 and arch/x86-64, but not anything outside of that - the path pattern gets rewritten to "arch/i386" and "arch/x86-64").

		Linus

PS. A number of the other "work tree" ops can be similarly extended to DTRT in git project subdirectories, but I wanted to finish off the "git diff" family first, and get that one all done. I think I'm done now, and I might tackle the other things (git-update-cache, git-checkout-cache, git-commit-script, etc) tomorrow.

Previous: Linus TorvaldsNext: Alex Riesen
Message 2 of 4 in “Improve handling of "." and ".." in git-diff-*”
  1. Linus TorvaldsAug 17, 2005
  2. Linus TorvaldsAug 17, 2005
  3. Alex RiesenAug 23, 2005
  4. Alex RiesenAug 23, 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.