On Mon, May 8, 2023 at 3:44 AM Tao Klerks <tao@xxxxxxxxxx> wrote: > > On Sun, May 7, 2023 at 4:48 AM Elijah Newren <newren@xxxxxxxxx> wrote: > > > > On Wed, May 3, 2023 at 10:01 PM Tao Klerks <tao@xxxxxxxxxx> 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".