summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99d698f)
raw | patch | inline | side by side (parent: 99d698f)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 12 Jul 2008 14:56:19 +0000 (15:56 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 13 Jul 2008 08:03:10 +0000 (01:03 -0700) |
If you want to reuse the rerere cache in another repository, and set
a symbolic link to it, you do not want to have the two repositories
interfer with each other by accessing the _same_ MERGE_RR.
For example, if you use contrib/git-new-workdir to set up a second
working directory, and you have a conflict in one working directory,
but commit in the other working directory first, the wrong "resolution"
will be recorded.
The easy solution is to move MERGE_RR out of the rr-cache/ directory,
which also corresponds with the notion that rr-cache/ contains cached
resolutions, not some intermediate temporary states.
Noticed by Kalle Olavi Niemitalo.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
a symbolic link to it, you do not want to have the two repositories
interfer with each other by accessing the _same_ MERGE_RR.
For example, if you use contrib/git-new-workdir to set up a second
working directory, and you have a conflict in one working directory,
but commit in the other working directory first, the wrong "resolution"
will be recorded.
The easy solution is to move MERGE_RR out of the rr-cache/ directory,
which also corresponds with the notion that rr-cache/ contains cached
resolutions, not some intermediate temporary states.
Noticed by Kalle Olavi Niemitalo.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c | patch | blob | history | |
builtin-rerere.c | patch | blob | history | |
t/t4200-rerere.sh | patch | blob | history |
diff --git a/branch.c b/branch.c
index 56e949232cac1fe9dbe23aa93b50fe2f7c55c07d..b1e59f2196b933ab7169a30efc5d1d340f8f9c5c 100644 (file)
--- a/branch.c
+++ b/branch.c
void remove_branch_state(void)
{
unlink(git_path("MERGE_HEAD"));
- unlink(git_path("rr-cache/MERGE_RR"));
+ unlink(git_path("MERGE_RR"));
unlink(git_path("MERGE_MSG"));
unlink(git_path("SQUASH_MSG"));
}
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 69c3a52d5e98818dcd4407e75ae9cfff938710a6..1db2e0c8fbc90c81de7a7a7fc5beca7316c5b2d7 100644 (file)
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
if (!is_rerere_enabled())
return -1;
- merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
+ merge_rr_path = xstrdup(git_path("MERGE_RR"));
fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
read_rr(merge_rr);
return fd;
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index cf10557dd277cbd221c69fb42add15e956c1793b..b5a4202998f51cd282ae46c7caec6e615ee47e3f 100755 (executable)
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
! git merge first
'
-sha1=$(sed -e 's/ .*//' .git/rr-cache/MERGE_RR)
+sha1=$(sed -e 's/ .*//' .git/MERGE_RR)
rr=.git/rr-cache/$sha1
test_expect_success 'recorded preimage' "grep ^=======$ $rr/preimage"
test_expect_success 'rerere prefers first change' 'test_cmp a1 expect'
rm $rr/postimage
-echo "$sha1 a1" | perl -pe 'y/\012/\000/' > .git/rr-cache/MERGE_RR
+echo "$sha1 a1" | perl -pe 'y/\012/\000/' > .git/MERGE_RR
test_expect_success 'rerere clear' 'git rerere clear'
git add file2 &&
git commit -m version2 &&
! git merge fourth &&
- sha1=$(sed -e "s/ .*//" .git/rr-cache/MERGE_RR) &&
+ sha1=$(sed -e "s/ .*//" .git/MERGE_RR) &&
rr=.git/rr-cache/$sha1 &&
echo Cello > file2 &&
git add file2 &&