git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Torek <chris.torek@gmail.com>
To: Phil Hord <phil.hord@gmail.com>
Cc: Tassilo Horn <tsdh@gnu.org>, Jeff King <peff@peff.net>,
	Git <git@vger.kernel.org>
Subject: Re: [Bug] Stashing during merge loses MERGING state
Date: Thu, 11 Mar 2021 23:02:16 -0800	[thread overview]
Message-ID: <CAPx1GvfguSyXznaaeQYB8JY96vmZmzOJyTnXX1yP3omeXptqXw@mail.gmail.com> (raw)
In-Reply-To: <CABURp0pFdHAx_+-e+O35Qxtbe3_+cZy9SZcOSeR2R7v_neRwKg@mail.gmail.com>

On Thu, Mar 11, 2021 at 9:19 PM Phil Hord <phil.hord@gmail.com> wrote:
> I wonder if a fix could be as simple as recording the MERGE_HEAD as
> the third parent commit of the stash ref.

There is already a third parent, but only when using -u / -a: this
third-parent commit holds the untracked files (which are then removed
a la `git clean`).

A better trick would, I think, be able to save a partial merge state
in general, including the unmerged statuses of various files, the
ongoing action (merge or one of the other things that use it), and
so on, in a form that could be restored later.  A plain `git stash` in
any partially-merged state should tell you: no, use the fancier
merge-state-saver instead.

> I think being able to stash during a merge conflict could be very
> useful.  I do sometimes need to get back to a working state
> momentarily and a merge conflict represents a long pole to doing so.
> Similarly, it could be useful to stash a conflicted `git rebase` so I
> could return to it later and pick up where I left off.  Now we really
> would need to store some extra metadata, though, like the todo-list
> and ORIG_HEAD.  And we would definitely need some extra command line
> switch to tell stash (or rebase) that I want to include all the rebase
> state and also "pause" the rebase by restoring to my starting point.

This is the sort of thing I'm thinking of, for the "superstash" (terrible
name for it). Note that whatever this becomes, it should be send-able
(via push and/or email) so that you can have multiple people work
on resolving a particularly hairy merge.

Chris

  parent reply	other threads:[~2021-03-12  7:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 14:00 [Bug] Stashing during merge loses MERGING state Tassilo Horn
2021-03-11 19:25 ` Jeff King
2021-03-11 20:31   ` Tassilo Horn
2021-03-12  5:00     ` Phil Hord
2021-03-12  6:09       ` Junio C Hamano
2021-03-12  7:04         ` Elijah Newren
2021-03-12  7:02       ` Chris Torek [this message]
2021-03-12  7:17         ` Elijah Newren
2021-03-12  7:02       ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPx1GvfguSyXznaaeQYB8JY96vmZmzOJyTnXX1yP3omeXptqXw@mail.gmail.com \
    --to=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=phil.hord@gmail.com \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).