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

Re: [PATCH] use refnames instead of "left"/"right" in dirdiffs

From
CMChristoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Date
Mar 28, 2013, 12:46 UTC
Message-ID
<1364474776.11891.9.camel@heisenberg.scientia.net>
In-Reply-To
<20130327230715.GU2286@serenity.lan>
Hi John.
On Wed, 2013-03-27 at 23:07 +0000, John Keeping wrote: 
> That's not going to work well on Windows, is it?

Uhm Winwhat? No seriously... doesn't dir-diff fail ther anway? The mkdir right now also uses mkpath with "/"... and I could read in it's documentation that it would automatically translate this, does it?

>  Anything with two dots
> in is already forbidden so we don't need to worry about that

Sure about this? I mean they're forbidden as refnames, but is this really checked within git-difftool before?

> ; I'm not
> sure we need to remove forward slashes at all

Mhh could be... seems that the cleanup happens via completely removing the $tmpdir path. And for the actual diff it shouldn't matter when there's a partentdir more.

>  until we consider the
> "commit containing" syntax ':/fix nasty bug' or 'master^{/fix bug}'.

Phew... don't ask me... I'm not that into the git source code... from the filename side, these shouldn't bother, only / an NUL is forbidden (in POSIX,... again I haven't checked win/mac which might not adhere to the standards).

> I'm more concerned with specifiers containing '^', '@', '{', ':' - see
> 'SPECIFYING REVISIONS' in git-rev-parse(1) for the full details of
> what's acceptable.

Mhh there are likely more problems... I just noted that $ldir/$rdir are used in a call to system() so... that needs to be shell escaped to prevent any bad stuff And if perl (me not a perl guy) interprets any such characters specially in strings, it must be handled either.

> At some point I think it may be better to fall back
> to the SHA1 of the relevant commit.
Think that would be quite a drawback...

Cheers, Chris.

Previous: John KeepingNext: John Keeping
Message 3 of 5 in “use refnames instead of "left"/"right" in dirdiffs”
  1. use refnames instead of "left"/"right" in dirdiffsChristoph Anton Mitterer, Mar 27, 2013
  2. John KeepingMar 27, 2013
  3. Christoph Anton MittererMar 28, 2013
  4. John KeepingMar 28, 2013
  5. John KeepingMar 28, 2013

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.