Skip to content

rebase: add switches to control todo-list setup

Phil Hord git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rebase: add switches for drop, edit and rewordbuiltin/rebase--interactive.c builtin/rebase.c sequencer.c +1 more+192 -170 replies
2/2rebase: add --break switchbuiltin/rebase--interactive.c builtin/rebase.c sequencer.c +1 more+15 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH/RFC 0/2] rebase: add switches to control todo-list setup

From: Phil Hord <[email protected]>

I have a local patch to rebase--interactive.sh that adds "edit" switches to rebase, permitting me to say, for example,

    git rebase --drop $sha

This command creates a todo-list but drops the mentioned commit from the list by changing the "pick" to "drop". Other switches let me edit or reword a commit in my local history, greatly simplifying my branch grooming workflow.

With the conversion to rebase.c (yay!) my tools are going away. I'm porting them to the rewritten rebase*.c and I want to submit them here. But rebase*.c is still in flux, and my changes have many conflicts with other inflight changes. I'm happy to wait for those, but in the meantime, I'd appreciate some feedback on the utility and acceptability of my plan.

Here's my patch series as it stands today. It lacks documentation and tests, but it mostly works. Errors are not handled gracefully, but this will be rectified after I rebase onto pw/rebase-i-internal-rfc.

Currently it supports these switches:

usage: git rebase [-i] [options] [--exec <cmd>] ...
:
--break <revision> stop before the mentioned ref
--drop <revision> drop the mentioned ref from the todo list
--edit <revision> edit the mentioned ref instead of picking it
--reword <revision> reword the mentioned ref instead of picking it

I have plans to add these, but I don't like how their "onto" will be controlled. More thinking is needed here.

    --fixup <revision>    fixup the mentioned ref instead of picking it
    --squash <revision>   squash the mentioned ref instead of picking it
    --pick <revision>     pick the mentioned ref onto the start of the list

Phil Hord (2):
rebase: add switches for drop, edit and reword
rebase: add --break switch

 builtin/rebase--interactive.c |  49 +++++++++++++++-
 builtin/rebase.c              |  48 ++++++++++++++++
 sequencer.c                   | 105 +++++++++++++++++++++++++++++-----
 sequencer.h                   |  22 ++++++-
 4 files changed, 207 insertions(+), 17 deletions(-)

--
2.20.1