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

Re: Bug: problem with file named with dash character

From
Jeff King <peff@peff.net>
Date
Jun 27, 2012, 21:00 UTC
Message-ID
<20120627210039.GA2292@sigill.intra.peff.net>
In-Reply-To
<7vvcic7a6t.fsf@alter.siamese.dyndns.org>
On Wed, Jun 27, 2012 at 01:48:42PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> >>> It is not ready yet, but here are a few patches WIP.
> >>
> >> And this is the second clean-up
> >
> > And this is the third one.
> 
> Some of the other breakages that comes from the "no-index" codepath
> that we may want to consider addressing I have found so far are:
>From a cursory look, these definitely go in the right direction. I like

how the third one was able to rip populate_from_stdin entirely out of diff.c.

I suspect we could get by without even the nongit_stdin flag you added; the only place which uses it is diff_fill_sha1_info, but theoretically we don't even need it there; we could just index_mem the file contents we get via diff_populate_filespec, and the stdin contents will already be there.

Right now we call index_path for worktree files, but I don't really see much point; we have to read the whole data either way, and populate_filespec should be mmap-ing them for us.

>  - We say on the "diff --git" header uglyness like "a/-", "b/-";
>    likewise in the metainfo;

I'd consider changing the path to "/dev/stdin" for this case. It doesn't exist on some platforms, of course, but neither does /dev/null, which we use similarly.

>  - We show on the "index" header "0*" value for these entries, even
>    though we should be able to compute it (after all we do so for
>    files on disk in a non-git directory);
The index_mem I mentioned above would fix that.
>  - We still apply attributes and textconv as if we are dealing with
>    a regular file "-" at the root level.

I think that's bad. I wonder if it should have "*" attributes applied to it or not. While I can see it being convenient in some cases, I think it makes the rules confusingly complex.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 13 in “Bug: problem with file named with dash character”
  1. Daniel Lyubomirov -|- Digitalus BulgariaJun 27, 2012
  2. faux@goeswhere.comJun 27, 2012
  3. Junio C HamanoJun 27, 2012
  4. Jeff KingJun 27, 2012
  5. Jeff KingJun 27, 2012
  6. Junio C HamanoJun 27, 2012
  7. Junio C HamanoJun 27, 2012
  8. Junio C HamanoJun 27, 2012
  9. Junio C HamanoJun 27, 2012
  10. Junio C HamanoJun 27, 2012
  11. Jeff KingJun 27, 2012
  12. Junio C HamanoJun 27, 2012
  13. Jeff KingJun 27, 2012

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.