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

[RFC/PATCH] stash: Delete MERGE_RR before stash apply

From
Phil Hord <phil.hord@gmail.com>
Date
Jul 5, 2012, 13:48 UTC
Message-ID
<CABURp0pNsRQgbf7_iYc-xVaySa9-gGiA++Lw4-WgSCQ4QGCXsA@mail.gmail.com>

The presence of a GIT_DIR/MERGE_RR file indicates we were resolving a merge which had rerere candidates for recording. But the file does not get deleted after all resolutions are completed. This is ok for most cases because the file will get replaced when the next merge happens. But stash apply does not use a merge that supports rerere, and so the old MERGE_RR does not get replaced with a current one.

This then confuses mergetool who thinks a rerere operation is in play when it is not.

Fix this by ensuring there is no leftover MERGE_RR file whenever we are beginning a git stash apply.

Signed-off-by: Phil Hord <hordp@cisco.com>
---

This feels like a hack and like it is in the wrong location. However, the change is minimal and should fix my specific problem[1].

[1] http://comments.gmane.org/gmane.comp.version-control.git/200178
 git-stash.sh | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/git-stash.sh b/git-stash.sh
index 4e2c7f8..0b96e2f 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -409,6 +409,9 @@ apply_stash () {

        assert_stash_like "$@"

+       test -f "$GIT_DIR/MERGE_RR" &&
+               git rerere clear
+
        git update-index -q --refresh || die "$(gettext "unable to
refresh index")"

        # current index state
-- 
1.7.11.1.161.g0f17059.dirty
Next: Junio C Hamano
Message 1 of 13 in “stash: Delete MERGE_RR before stash apply”
  1. stash: Delete MERGE_RR before stash applyPhil Hord, Jul 5, 2012
  2. Junio C HamanoJul 5, 2012
  3. Phil HordJul 6, 2012
  4. Junio C HamanoJul 6, 2012
  5. Phil HordJul 6, 2012
  6. 0/2 stash: invoke rerere in case of conflictPhil Hord, Jul 7, 2012
  7. 1/2 test: git-stash conflict sets up rererePhil Hord, Jul 7, 2012
  8. Junio C HamanoJul 9, 2012
  9. Phil HordJul 9, 2012
  10. Junio C HamanoAug 16, 2012
  11. Phil HordAug 17, 2012
  12. Junio C HamanoAug 17, 2012
  13. 2/2 stash: invoke rerere in case of conflictPhil Hord, Jul 7, 2012

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.