Re: RFH: refactor read-tree
From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:33
On Sun, 9 Jul 2006, Johannes Schindelin wrote:
On Sun, 9 Jul 2006, Alex Riesen wrote:quoted
Linus Torvalds, Sun, Jul 09, 2006 05:15:41 +0200:quoted
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 branch1what 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