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

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “doc/read-tree: remove obsolete remark”
  1. doc/read-tree: remove obsolete remarkAndreas G. Schacker, Jan 9, 2018
  2. Junio C HamanoJan 9, 2018
  3. Jeff KingJan 11, 2018
  4. Junio C HamanoJan 11, 2018
  5. Jeff KingJan 11, 2018
  6. Junio C HamanoJan 11, 2018
  7. Jeff KingJan 12, 2018

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.