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

Re: RFH: refactor read-tree

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 9, 2006, 15:30 UTC
Message-ID
<Pine.LNX.4.64.0607090827430.5623@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.63.0607091630110.29667@wbgn013.biozentrum.uni-wuerzburg.de>
On Sun, 9 Jul 2006, Johannes Schindelin wrote:
Show 15 quoted lines
> 
> On Sun, 9 Jul 2006, Alex Riesen wrote:
> 
> > Linus Torvalds, Sun, Jul 09, 2006 05:15:41 +0200:
> > > The basic idea is that "branch1" should be your current branch, and it 
> > > obviously is also expected to match (more or less) the current index. So 
> > > you can do a merge by
> > > 
> > >  - reading in "branch1" into the index:
> > > 
> > > 	GIT_INDEX_FILE=.git/tmp-index git-read-tree -m branch1
> > 
> > what is "-m" here for?
> 
> It means that git-read-tree tries to merge the current index with branch1.

Well, the current index always "merges" by just taking the timestamps from it. The actual _content_ doesn't matter for the single-tree case.

For the two- and three-tree case, "git-read-tree -m" will verify that the parts that got changed still _match_ in the index, but for a single-tree "git-read-tree", there's nothing to match against, just the target, so the only thing it does is that for matching index/target-tree entries it will re-use the index timestamps (and other stat info).

			Linus
Previous: Johannes SchindelinNext: Alex Riesen
Message 5 of 7 in “RFH: refactor read-tree”
  1. Johannes SchindelinJul 8, 2006
  2. Linus TorvaldsJul 9, 2006
  3. Alex RiesenJul 9, 2006
  4. Johannes SchindelinJul 9, 2006
  5. Linus TorvaldsJul 9, 2006
  6. Alex RiesenJul 9, 2006
  7. Johannes SchindelinJul 9, 2006

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.