git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-rebase --undo-skip proposal
@ 2018-02-13 20:22 Psidium Guajava
  2018-02-13 20:42 ` Stefan Beller
  0 siblings, 1 reply; 10+ messages in thread
From: Psidium Guajava @ 2018-02-13 20:22 UTC (permalink / raw)
  To: git

Hello git community,

I'd like to add a new feature in git-rebase: --undo-skip.
But first, I'd like to consult with the experts if it would be
beneficial for the project and if my line of tought is correct.

Imagine that you are working on a feature for a long time, but there
are multiple bug fixes happening at `master` branch at the same time.
After lots of commits on both ends, you decide to rebase your changes
on top of the current `master` branch.
After lots of conflict resolution steps, you mistakenly call
`git-rebase --skip` instead of `git-rebase --continue`, thus losing a
commit of your work, and possibly inserting bugs in your project.
The only solution for this right now would be to abort the current
rebase and start over.

It seems that a feature like this have been requested once on the mail list [1].

I propose the existence of --undo-skip on git-rebase's `$action` domain.

How I fixed it when that happened with me was (just after running the
wrong skip):

1. I figured I was making a rebase that used `git-am` as a backend.
2. In the rebase-apply directory I searched for the patch file with
the change I just skipped.
3. Found the `rebase-apply/next` file.
4. Wrote the number of the patch I skipped - 1 in rebase-apply/next.
5. run `git rebase --skip` again on the repository.

This made the lost patch appear again and I could `--continue` it this time.

I propose the addition of an action `--undo-skip`, that could be
called only after a wrongfully called `--skip`.
`git rebase --undo-skip`.
I would implemented it to do programatically what I did by hand when
that happened with me.

Here are my questions for you:
1. Would this be beneficial for the users?
2. For `rebase--am`, I would need to change `git-rebase--am.sh` file, correct?
3. Can I assume `builtin/am.c` will always store its information on
`$state_dir/next` and `$state_dir/$patchnumbers`?
4. How hard would it be to add that logic for `rebase--interactive`
and `rebase--merge` backends?

Also, a little unrelated with this issue:
5. What happened to the rewrite of rebase in C [2]? I couldn't find
any information after 2016.

[1] https://public-inbox.org/git/201311011522.44631.thomas@koch.ro/
[2] https://public-inbox.org/git/1457779597-6918-1-git-send-email-pyokagan@gmail.com/


Best Regards,
Gabriel Borges

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-15 13:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-13 20:22 git-rebase --undo-skip proposal Psidium Guajava
2018-02-13 20:42 ` Stefan Beller
2018-02-15  0:36   ` Psidium Guajava
2018-02-15  0:53     ` Johannes Schindelin
2018-02-15  1:23       ` Jacob Keller
2018-02-15 13:02         ` Johannes Schindelin
2018-02-15  1:50       ` Psidium Guajava
2018-02-15  4:50         ` Jacob Keller
2018-02-15 13:06           ` Johannes Schindelin
2018-02-15 10:11   ` Paul Tan

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).