Re: [PATCH] Add contrib/rerere-train script
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 29, 2008, 12:39 UTC
- Message-ID
- <alpine.DEB.1.00.0809291430050.16478@pacific.mpi-cbg.de.mpi-cbg.de>
- In-Reply-To
- <20080927204415.6117@nanako3.lavabit.com>
Hi,
On Sat, 27 Sep 2008, Nanako Shiraishi wrote:
> This script takes a range of commits (e.g. maint..next) as its > arguments, recreates merge commits in the range to prime rr-cache > database.
Cute idea. However, I would _love_ to have this as an option to git-rerere, which would work in memory only.
This is how I would do it (if I had enough time to play with Git):
- teach merge_recursive_options not to write anything to the working directory (should be relatively easy, as many parts of merge-recursive.c already have no_wd/update_wd/!o->call_depth checks for that),
- refactor handle_file() in rerere.c to provide an in-memory-only version,
- teach rerere to call merge_recursive() with the in-memory-only option, and then call the in-memory version of the handle_file() function for all unmerged paths, using the resolutions from the given merge commit.
- then teach this new function to take an arbitrary commit range (but only handling the two-parent merges within it).
Ciao, Dscho