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

Re: [PATCH] stash: dont save during a conflicted merge

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 15, 2010, 22:14 UTC
Message-ID
<7vhbohdygu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1268451633-30046-1-git-send-email-cxreg@pobox.com>
Dave Olszewski <cxreg@pobox.com> writes:
Show 8 quoted lines
> Similar to commit c8c562a, if a user is resolving conflicts, they may
> think it wise to stash their current work tree and git pull to see if
> there are additional changes on the remote.
>
> The stash will fail to save if the index contains unmerged entries, but
> if the conflicts are resolved, the stash will succeed, and both
> MERGE_HEAD and MERGE_MSG will be removed.  This is probably a mistake,
> and we should warn the user and refuse to stash.
Warning is probably Ok, but refusing with die() might be too much.

When trying a topic with more than one integration branches (think "master", "next, "pu"), and the merge is a bit too hairy that I am not very confident with the resolution, I've deliberately used stash to record a tentative conflict resolution to avoid contaminating my rerere database:

    $ git merge topic
    ... heavy conflicts, manually "resolved" to a dubious result ...
    $ git rerere clear
    $ git stash save "tentative merge of topic"
    $ git stash apply
    ... test test test ...
    $ git reset --hard
    $ git checkout another-integration-branch
    $ git stash apply
    ... test test test ...
    ... repeat the above for other integration branches ...
This is using the stash as a glorified form of
    $ git diff HEAD >./+save-tentative-merge
and then applying it to other integration branches to test out
    $ git reset --hard
    $ git checkout another-integration-branch
    $ git apply ./+save-tentative-merge

but it actually is better than diff/apply because stash application uses a real three-way merge.

So I am not entirely happy with this feature-removal.
Previous: Dave OlszewskiNext: Dave Olszewski
Message 2 of 3 in “stash: dont save during a conflicted merge”
  1. stash: dont save during a conflicted mergeDave Olszewski, Mar 13, 2010
  2. Junio C HamanoMar 15, 2010
  3. Dave OlszewskiMar 16, 2010

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.