Web lists-archives.com

Re: [PATCH] doc/read-tree: remove obsolete remark




Jeff King <peff@xxxxxxxx> writes:

> On Thu, Jan 11, 2018 at 11:02:04AM -0800, Junio C Hamano wrote:
>
>> >> ---prefix=<prefix>/::
>> >> +--prefix=<prefix>::
>> >>  	Keep the current index contents, and read the contents
>> >>  	of the named tree-ish under the directory at `<prefix>`.
>> >>  	The command will refuse to overwrite entries that already
>> >> -	existed in the original index file. Note that the `<prefix>/`
>> >> -	value must end with a slash.
>> >> +	existed in the original index file.
>> >
>> > Is it worth mentioning in the new world order that the slash is not
>> > implied? I.e., that you probably do want to say "--prefix=foo/" if you
>> > want the subdirectory "foo", but do not want to match "foobar"?
>> 
>> Doesn't "git read-tree --prefix=previous HEAD^" add paths like
>> "previous/Documentation/Makefile" to the index, i.e. instead of
>> forcing you to have the required slash at the end, we give one for
>> free when it is missing?
>
> Yes, I think it does what you'd want with that path. But it would not do
> what you want by adding "previous-file". Which seems like a gotcha that
> should be mentioned.

I am a bit puzzled.  

Do you mean a user who types "git read-tree --prefix=v1- HEAD^" may
be expecting to see that the blob object "HEAD^:Makefile" added at
path "v1-Makefile" etc?