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

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

From
Alex Riesen <raa.lkml@gmail.com>
Date
Aug 23, 2005, 19:54 UTC
Message-ID
<81b0412b05082312542bd1ecc@mail.gmail.com>
In-Reply-To
<81b0412b050823124938d735bf@mail.gmail.com>
On 8/23/05, Alex Riesen <raa.lkml@gmail.com> wrote:
Show 6 quoted lines
> On 8/17/05, Linus Torvalds <torvalds@osdl.org> wrote:
> > NOTE! This does _not_ handle ".." or "." in the _middle_ of a pathspec. If
> > you have people who do
> 
> BTW, could this (below) be useful for something?
> 

Well, a bit of explanation is certainly missing, sorry. The code tries to emulate (on purely text level) the behaviour of chdir(2), including stopping at root, going back and forth and removing useless (not changing directory) parts like "/./".

The file in the previous message can be tested with :
  gcc -DCHECK_PATHEXPAND patchexpand.c && ./aout

Cheers, Alex Riesen.

PS: Before anyone asked: the code is mine and free for any use.
Previous: Alex Riesen
Message 4 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.