Re: [PATCH] doc/read-tree: remove obsolete remark
- From
Jeff King <peff@peff.net>
- Date
- Jan 11, 2018, 22:21 UTC
- Message-ID
- <20180111222155.GA13570@sigill.intra.peff.net>
- In-Reply-To
- <xmqqbmi0z0b7.fsf@gitster.mtv.corp.google.com>
On Thu, Jan 11, 2018 at 11:02:04AM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> >> ---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.
-Peff