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

Re: [PATCH] RFC: switch: allow same-commit switch during merge if conflicts resolved

From
Elijah Newren <newren@gmail.com>
Date
May 11, 2023, 07:06 UTC
Message-ID
<CABPp-BHGAVb06BahQ0--15LWetyyx7eHAoPH8-So9UyqpJv0sg@mail.gmail.com>
In-Reply-To
<CAPMMpojDm8jHWFr8i5EC-oEKK8WBt1g3iyRvixfy1bhk8qck2g@mail.gmail.com>
On Mon, May 8, 2023 at 3:44 AM Tao Klerks <tao@klerks.biz> wrote:
Show 61 quoted lines
>
> On Sun, May 7, 2023 at 4:48 AM Elijah Newren <newren@gmail.com> wrote:
> >
> > On Wed, May 3, 2023 at 10:01 PM Tao Klerks <tao@klerks.biz> wrote:
> > >
> > > I believe this question was resolved later in the thread. The proposal
> > > is to allow the simplest case of merge only, for resolved
> > > (unconflicted) indexes only. If the change were to make sense I could
> > > update this message to be clearer that none of those other operations
> > > or situations are impacted by this change.
> >
> > As I mentioned to Junio, I understood fully that your implementation
> > limited the changes to this one case.  That did not resolve my
> > concerns, it merely obviated some other bigger ones that I didn't
> > raise.
> >
> > However, making it only available via a --force override (and then
> > perhaps also limiting it to just some operations), would resolve my
> > concerns.
> >
>
> Hmm, I think there is confusion here.
>
> My proposal was (and now, again, is) to add support for "--force" to
> "git switch", and to keep and improve that existing support for "git
> checkout" (where it is in my opinion broken during a rebase), but that
> proposal was mostly-unrelated to my main goal and proposal for
> supporting same-commit switches in the first place:
>
> A same-commit switch (*without* --force) serves the use-case of
> *completing a merge on another branch*. This is, as far as I can tell
> only *useful* for merges:
>  * during a rebase, switching in the middle (to the same commit,
> without --force) won't achieve anything useful; your rebase is still
> in progress, any previously rebased commits in the sequence are lost,
> and if you continue the rebase you'll end up with a very strange and
> likely-surprising partial rebase state)
>  * during a cherry-pick, it's just "not very useful" - it's not bad
> like rebase, because in-progress cherry-pick metadata is destroyed
>  * during am, and bisect I'm not sure, I haven't tested yet.
>
> The reason this in-progress is *valuable* for merges (in a way that it
> is not for those other states) is that the merge metadata not only
> says what you're in the middle of, but also contains additional useful
> information about what you've done so far, which you want to have be a
> part of what you commit in the end - the identity of the commit you
> were merging in.
>
> Supporting switch with --force, and having it implicitly destroy
> in-progress operation metadata, has value in that it makes it easier
> to break backwards compatibility of "git checkout" without impacting
> users' or tests' workflows; it helps make a change to make checkout
> safer; but it does not help with my other (/main?) objective of making
> it easy and intuitive to switch to another same-commit branch, to be
> able to commit your in-progress merge on another branch and avoid
> committing it where you started.
>
> Hence, if/when we add support for same-commit switching during merge
> (and potentially other operations, if that makes sense), it should
> *not* take "--force", which has a substantially different purpose and
> meaning.

Doh, sorry, brain fart on my part forgetting the checkout/switch already have a "--force". Replace "--force" in my email with "an override" such as "--ignore-in-progress".

Previous: Tao KlerksNext: Tao Klerks
Message 16 of 17 in “RFC: switch: allow same-commit switch during merge if conflicts resolved”
  1. RFC: switch: allow same-commit switch during merge if conflicts resolvedTao Klerks via GitGitGadget, May 2, 2023
  2. Elijah NewrenMay 2, 2023
  3. Junio C HamanoMay 2, 2023
  4. Elijah NewrenMay 3, 2023
  5. Tao KlerksMay 4, 2023
  6. Tao KlerksMay 5, 2023
  7. Elijah NewrenMay 7, 2023
  8. Elijah NewrenMay 7, 2023
  9. Felipe ContrerasMay 7, 2023
  10. Tao KlerksMay 8, 2023
  11. Felipe ContrerasMay 8, 2023
  12. Tao KlerksMay 8, 2023
  13. Junio C HamanoMay 8, 2023
  14. Felipe ContrerasMay 9, 2023
  15. Tao KlerksMay 8, 2023
  16. Elijah NewrenMay 11, 2023
  17. Tao KlerksMay 21, 2023

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.