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

Re: [PATCH 2/2] diff: generate prettier filenames when using GIT_EXTERNAL_DIFF

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 27, 2009, 07:14 UTC
Message-ID
<4A1CE853.9080305@viscovery.net>
In-Reply-To
<20090527070221.GC2986@gmail.com>
David Aguilar schrieb:
Show 8 quoted lines
> On Wed, May 27, 2009 at 08:34:57AM +0200, Johannes Sixt wrote:
>> David Aguilar schrieb:
>>> +#include <libgen.h>
>> We don't have libgen.h on Windows :-( (at least not with my aging gcc
>> 3.something). Would you please open-code the call to basename()?
> 
> I don't know much about Windows.
> Do we need to check for \ in addition to /?

If the paths have been taken from the index or have passed through get_pathspec or prefix_filename, then it is sufficient to check for '/'. Otherwise, use is_dir_sep() (note it is a macro: don't call it like is_dir_sep(*c++)).

-- Hannes
Previous: David AguilarNext: Jakub Narebski
Message 7 of 8 in “compat: add a mkstemps() compatibility function”
  1. 1/2 compat: add a mkstemps() compatibility functionDavid Aguilar, May 27, 2009
  2. 2/2 diff: generate prettier filenames when using GIT_EXTERNAL_DIFFDavid Aguilar, May 27, 2009
  3. David AguilarMay 27, 2009
  4. Johannes SixtMay 27, 2009
  5. David AguilarMay 27, 2009
  6. David AguilarMay 27, 2009
  7. Johannes SixtMay 27, 2009
  8. Jakub NarebskiMay 27, 2009

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.