Re: Bug: problem with file named with dash character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 27, 2012 at 01:48:42PM -0700, Junio C Hamano wrote:

> >>> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]