Skip to content

Commit e51a92e

Browse files
committed
Suggest allowing git rebase --interactive todo lines to take options
1 parent 9e4fe87 commit e51a92e

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

SoC-2014-Ideas.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,64 @@ and repair broken history.
194194
- Language: C, optional choice of scripting language
195195
- Difficulty: medium
196196
- Possible mentors: Jeff King / Michael Haggerty
197+
198+
## Line options for `git rebase --interactive`
199+
200+
One of the more powerful features in Git is the command `git rebase
201+
--interactive`, which allows recent commits to be reordered, squashed
202+
together, or even revised completely. The command creates a todo list
203+
and opens it in an editor. The original todo list might look like:
204+
205+
pick deadbee Implement feature XXX
206+
pick c0ffeee The oneline of the next commit
207+
pick 01a01a0 This change is questionable
208+
pick f1a5c00 Fix to feature XXX
209+
pick deadbab The oneline of the commit after
210+
211+
The user can edit the list to make changes to the history, for example
212+
to
213+
214+
pick deadbee Implement feature XXX
215+
squash f1a5c00 Fix to feature XXX
216+
exec make
217+
edit c0ffeee The oneline of the next commit
218+
pick deadbab The oneline of the commit after
219+
220+
This would cause commits `deadbee` and `f1a5c00` to be squashed
221+
together into one commit followed by running `make` to test-compile
222+
the results, delete commit `01a01a0` altogether, and stop after
223+
committing commit `c0ffeee` to allow the user to make changes.
224+
225+
It would be nice to support more flexibility in the todo-list commands
226+
by allowing the commands to take options. Maybe
227+
228+
* Convert a commit into a merge commit:
229+
230+
pick -p c0ffeee -p e1ee712 deadbab The oneline of the commit after
231+
232+
* After squashing two commits, add a "Signed-off-by" line to the
233+
commit log message:
234+
235+
pick deadbee Implement feature XXX
236+
squash --signoff f1a5c00 Fix to feature XXX
237+
238+
or GPG-sign a commit:
239+
240+
pick --gpg-sign=<keyid> deadbee Implement feature XXX
241+
242+
* Reset the author of the commit to the current user or a specified
243+
user:
244+
245+
pick --reset-author deadbee Implement feature XXX
246+
pick --author="A U Thor <author@example.com>" deadbab The oneline of the commit after
247+
248+
The goal of this project would be (1) to add the infrastructure for
249+
handling options on todo-list lines, and (2) implement some concrete
250+
options. A big part of the difficulty of this project is that `git
251+
rebase --interactive` is implemented via a sparsely-commented shell
252+
script. Adding comments and cleaning up the script as you go would be
253+
very welcome.
254+
255+
- Language: sh
256+
- Difficulty: medium
257+
- Possible mentors: Michael Haggerty

0 commit comments

Comments
 (0)