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

git-new-workdir should not share .git/rr-cache/MERGE_RR

From
KNKalle Olavi Niemitalo <kon@iki.fi>
Date
Jul 12, 2008, 11:27 UTC
Message-ID
<87skufmjg4.fsf@Astalo.kon.iki.fi>

The contrib/workdir/git-new-workdir script makes .git/rr-cache in each workdir a symlink to the shared .git/rr-cache directory. This lets git-rerere share conflict resolutions between workdirs. However, that directory also contains .git/rr-cache/MERGE_RR, which lists the files for which conflict resolutions should be saved in the next commit. It is thus possible that git-merge in one workdir records conflicts to the shared MERGE_RR file, and git-commit in another workdir saves the staged files to rr-cache as conflict resolutions, even though those files are from a different branch and never saw the merge. Such invalid conflict resolutions need then be separately deleted. This happened to me, with git version 1.5.6.

I don't see any way to modify the symlinks made by git-new-workdir so that new SHA-1 directories in .git/rr-cache would be shared but .git/rr-cache/MERGE_RR would not. On IRC, "gitte" suggested changing Git to use $GIT_DIR/MERGE_RR instead of $GIT_DIR/rr-cache/MERGE_RR. I suppose compatibility with people's existing repositories would require the modified Git to keep reading $GIT_DIR/rr-cache/MERGE_RR too, so that Git could be painlessly upgraded during a merge, but it is not obvious to me how lock files should then work.

Alternatively, the SHA-1 directories in .git/rr-cache could be moved to a subdirectory; then git-new-workdir could be changed to symlink only that subdirectory.

Next: Johannes Schindelin
Message 1 of 5 in “git-new-workdir should not share .git/rr-cache/MERGE_RR”
  1. Kalle Olavi NiemitaloJul 12, 2008
  2. 1/2 Move MERGE_RR from .git/rr-cache/ into .git/Johannes Schindelin, Jul 12, 2008
  3. 2/2 git-gui: MERGE_RR lives in .git/ directly with newer Git versionsJohannes Schindelin, Jul 12, 2008
  4. Shawn O. PearceJul 13, 2008
  5. Junio C HamanoJul 13, 2008

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.