git-rebase: drop as git-rebase-kill-line is insufficient

18 views
Skip to first unread message

Matthew Persico

unread,
Jan 14, 2016, 3:00:12 PM1/14/16
to magit
My git log -3 (redacted slightly for privacy/security) is:

commit 632da26656bc4b5e5b1ca9bc5e26d34b5fc26dc8
Merge: 843454a 986b8e2
Author: Matthew Persico
Date: Thu Jan 14 14:37:41 2016 -0500

:Merge branch 'master' of ****:mpersico5/git_template

commit 843454a955280100c90fa66248d83c4edfbf5a8d
Author: Matthew Persico
Date: Thu Jan 14 14:34:46 2016 -0500

Added tags for documentation, options for testing and correction, more tests

commit 986b8e2a7d34ef1f30c67a0bf3b8f5f871a0123d
Author: Matthew Persico
Date: Fri Nov 27 16:17:52 2015 -0500

Added more checks, cmd line options.

The top two are garbage. I want to rebase onto the third by DROPPING the first two.

magit does not have 'd' defined, but rather uses k or C-k mapped to git-rebase-kill-line to simply delete the line, because if the line is not there, the commit is dropped.

However, in this case, there are only two lines and when I kill them both, I end up with an empty file and nothing happens.

I think we need to define 'd' to change the word to 'drop' on the line. May I enter an issue for this, fork the repo and submit a pull request at https://github.com/magit/magit?

Jonas Bernoulli

unread,
Jan 16, 2016, 5:55:20 AM1/16/16
to Matthew Persico, magit
What I would do in this situation is to move to the last commit I want
to keep (likely in an "Unpushed to ..." section) and then press "C-u x"
to do a `git reset --hard COMMIT_AT_POINT'.

I think `git-rebase.el' lacks support for the "drop" command because
`git rebase' itself did not support that at the time the respective
Emacs commands were created. At least I wasn't aware of "drop" until
now.

If you feel like it, then please add support for it. Otherwise I will
get to that eventually.

Noam Postavsky

unread,
Jan 16, 2016, 8:34:42 AM1/16/16
to Jonas Bernoulli, Matthew Persico, magit
On Sat, Jan 16, 2016 at 5:55 AM, Jonas Bernoulli <jo...@bernoul.li> wrote:
> I think `git-rebase.el' lacks support for the "drop" command because
> `git rebase' itself did not support that at the time the respective
> Emacs commands were created. At least I wasn't aware of "drop" until
> now.

Looks like it's only available since 2.6:
https://github.com/git/git/blob/8d530c4d64ffcc853889f7b385f554d53db375ed/Documentation/RelNotes/2.6.0.txt#L22

Matthew Persico

unread,
Jan 16, 2016, 9:44:37 AM1/16/16
to Noam Postavsky, Jonas Bernoulli, magit
I will be happy to submit a pull request. 
--
Matthew O. Persico
Reply all
Reply to author
Forward
0 new messages