@@ -134,9 +134,13 @@ test_expect_success 'prepare for rebase_i_conflicts' '
134
134
test_expect_success ' status during rebase -i when conflicts unresolved' '
135
135
test_when_finished "git rebase --abort" &&
136
136
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
137
+ LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
137
138
test_must_fail git rebase -i rebase_i_conflicts &&
138
139
cat >expected <<EOF &&
139
140
interactive rebase in progress; onto $ONTO
141
+ Last command done (1 command done):
142
+ pick $LAST_COMMIT one_second
143
+ No commands remaining.
140
144
You are currently rebasing branch ' \' ' rebase_i_conflicts_second' \' ' on ' \' ' $ONTO' \' ' .
141
145
(fix conflicts and then run "git rebase --continue")
142
146
(use "git rebase --skip" to skip this patch)
@@ -159,10 +163,14 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
159
163
git reset --hard rebase_i_conflicts_second &&
160
164
test_when_finished "git rebase --abort" &&
161
165
ONTO=$(git rev-parse --short rebase_i_conflicts) &&
166
+ LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
162
167
test_must_fail git rebase -i rebase_i_conflicts &&
163
168
git add main.txt &&
164
169
cat >expected <<EOF &&
165
170
interactive rebase in progress; onto $ONTO
171
+ Last command done (1 command done):
172
+ pick $LAST_COMMIT one_second
173
+ No commands remaining.
166
174
You are currently rebasing branch ' \' ' rebase_i_conflicts_second' \' ' on ' \' ' $ONTO' \' ' .
167
175
(all conflicts fixed: run "git rebase --continue")
168
176
@@ -183,14 +191,20 @@ test_expect_success 'status when rebasing -i in edit mode' '
183
191
git checkout -b rebase_i_edit &&
184
192
test_commit one_rebase_i main.txt one &&
185
193
test_commit two_rebase_i main.txt two &&
194
+ COMMIT2=$(git rev-parse --short rebase_i_edit) &&
186
195
test_commit three_rebase_i main.txt three &&
196
+ COMMIT3=$(git rev-parse --short rebase_i_edit) &&
187
197
FAKE_LINES="1 edit 2" &&
188
198
export FAKE_LINES &&
189
199
test_when_finished "git rebase --abort" &&
190
200
ONTO=$(git rev-parse --short HEAD~2) &&
191
201
git rebase -i HEAD~2 &&
192
202
cat >expected <<EOF &&
193
203
interactive rebase in progress; onto $ONTO
204
+ Last commands done (2 commands done):
205
+ pick $COMMIT2 two_rebase_i
206
+ edit $COMMIT3 three_rebase_i
207
+ No commands remaining.
194
208
You are currently editing a commit while rebasing branch ' \' ' rebase_i_edit' \' ' on ' \' ' $ONTO' \' ' .
195
209
(use "git commit --amend" to amend the current commit)
196
210
(use "git rebase --continue" once you are satisfied with your changes)
@@ -207,8 +221,11 @@ test_expect_success 'status when splitting a commit' '
207
221
git checkout -b split_commit &&
208
222
test_commit one_split main.txt one &&
209
223
test_commit two_split main.txt two &&
224
+ COMMIT2=$(git rev-parse --short split_commit) &&
210
225
test_commit three_split main.txt three &&
226
+ COMMIT3=$(git rev-parse --short split_commit) &&
211
227
test_commit four_split main.txt four &&
228
+ COMMIT4=$(git rev-parse --short split_commit) &&
212
229
FAKE_LINES="1 edit 2 3" &&
213
230
export FAKE_LINES &&
214
231
test_when_finished "git rebase --abort" &&
@@ -217,6 +234,12 @@ test_expect_success 'status when splitting a commit' '
217
234
git reset HEAD^ &&
218
235
cat >expected <<EOF &&
219
236
interactive rebase in progress; onto $ONTO
237
+ Last commands done (2 commands done):
238
+ pick $COMMIT2 two_split
239
+ edit $COMMIT3 three_split
240
+ Next command to do (1 remaining command):
241
+ pick $COMMIT4 four_split
242
+ (use "git rebase --edit-todo" to view and edit)
220
243
You are currently splitting a commit while rebasing branch ' \' ' split_commit' \' ' on ' \' ' $ONTO' \' ' .
221
244
(Once your working directory is clean, run "git rebase --continue")
222
245
@@ -239,7 +262,9 @@ test_expect_success 'status after editing the last commit with --amend during a
239
262
test_commit one_amend main.txt one &&
240
263
test_commit two_amend main.txt two &&
241
264
test_commit three_amend main.txt three &&
265
+ COMMIT3=$(git rev-parse --short amend_last) &&
242
266
test_commit four_amend main.txt four &&
267
+ COMMIT4=$(git rev-parse --short amend_last) &&
243
268
FAKE_LINES="1 2 edit 3" &&
244
269
export FAKE_LINES &&
245
270
test_when_finished "git rebase --abort" &&
@@ -248,6 +273,11 @@ test_expect_success 'status after editing the last commit with --amend during a
248
273
git commit --amend -m "foo" &&
249
274
cat >expected <<EOF &&
250
275
interactive rebase in progress; onto $ONTO
276
+ Last commands done (3 commands done):
277
+ pick $COMMIT3 three_amend
278
+ edit $COMMIT4 four_amend
279
+ (see more in file .git/rebase-merge/done)
280
+ No commands remaining.
251
281
You are currently editing a commit while rebasing branch ' \' ' amend_last' \' ' on ' \' ' $ONTO' \' ' .
252
282
(use "git commit --amend" to amend the current commit)
253
283
(use "git rebase --continue" once you are satisfied with your changes)
@@ -273,11 +303,20 @@ test_expect_success 'status: (continue first edit) second edit' '
273
303
FAKE_LINES="edit 1 edit 2 3" &&
274
304
export FAKE_LINES &&
275
305
test_when_finished "git rebase --abort" &&
306
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
307
+ COMMIT3=$(git rev-parse --short several_edits^) &&
308
+ COMMIT4=$(git rev-parse --short several_edits) &&
276
309
ONTO=$(git rev-parse --short HEAD~3) &&
277
310
git rebase -i HEAD~3 &&
278
311
git rebase --continue &&
279
312
cat >expected <<EOF &&
280
313
interactive rebase in progress; onto $ONTO
314
+ Last commands done (2 commands done):
315
+ edit $COMMIT2 two_edits
316
+ edit $COMMIT3 three_edits
317
+ Next command to do (1 remaining command):
318
+ pick $COMMIT4 four_edits
319
+ (use "git rebase --edit-todo" to view and edit)
281
320
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
282
321
(use "git commit --amend" to amend the current commit)
283
322
(use "git rebase --continue" once you are satisfied with your changes)
@@ -294,12 +333,21 @@ test_expect_success 'status: (continue first edit) second edit and split' '
294
333
FAKE_LINES="edit 1 edit 2 3" &&
295
334
export FAKE_LINES &&
296
335
test_when_finished "git rebase --abort" &&
336
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
337
+ COMMIT3=$(git rev-parse --short several_edits^) &&
338
+ COMMIT4=$(git rev-parse --short several_edits) &&
297
339
ONTO=$(git rev-parse --short HEAD~3) &&
298
340
git rebase -i HEAD~3 &&
299
341
git rebase --continue &&
300
342
git reset HEAD^ &&
301
343
cat >expected <<EOF &&
302
344
interactive rebase in progress; onto $ONTO
345
+ Last commands done (2 commands done):
346
+ edit $COMMIT2 two_edits
347
+ edit $COMMIT3 three_edits
348
+ Next command to do (1 remaining command):
349
+ pick $COMMIT4 four_edits
350
+ (use "git rebase --edit-todo" to view and edit)
303
351
You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
304
352
(Once your working directory is clean, run "git rebase --continue")
305
353
@@ -321,12 +369,21 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
321
369
FAKE_LINES="edit 1 edit 2 3" &&
322
370
export FAKE_LINES &&
323
371
test_when_finished "git rebase --abort" &&
372
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
373
+ COMMIT3=$(git rev-parse --short several_edits^) &&
374
+ COMMIT4=$(git rev-parse --short several_edits) &&
324
375
ONTO=$(git rev-parse --short HEAD~3) &&
325
376
git rebase -i HEAD~3 &&
326
377
git rebase --continue &&
327
378
git commit --amend -m "foo" &&
328
379
cat >expected <<EOF &&
329
380
interactive rebase in progress; onto $ONTO
381
+ Last commands done (2 commands done):
382
+ edit $COMMIT2 two_edits
383
+ edit $COMMIT3 three_edits
384
+ Next command to do (1 remaining command):
385
+ pick $COMMIT4 four_edits
386
+ (use "git rebase --edit-todo" to view and edit)
330
387
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
331
388
(use "git commit --amend" to amend the current commit)
332
389
(use "git rebase --continue" once you are satisfied with your changes)
@@ -343,12 +400,21 @@ test_expect_success 'status: (amend first edit) second edit' '
343
400
FAKE_LINES="edit 1 edit 2 3" &&
344
401
export FAKE_LINES &&
345
402
test_when_finished "git rebase --abort" &&
403
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
404
+ COMMIT3=$(git rev-parse --short several_edits^) &&
405
+ COMMIT4=$(git rev-parse --short several_edits) &&
346
406
ONTO=$(git rev-parse --short HEAD~3) &&
347
407
git rebase -i HEAD~3 &&
348
408
git commit --amend -m "a" &&
349
409
git rebase --continue &&
350
410
cat >expected <<EOF &&
351
411
interactive rebase in progress; onto $ONTO
412
+ Last commands done (2 commands done):
413
+ edit $COMMIT2 two_edits
414
+ edit $COMMIT3 three_edits
415
+ Next command to do (1 remaining command):
416
+ pick $COMMIT4 four_edits
417
+ (use "git rebase --edit-todo" to view and edit)
352
418
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
353
419
(use "git commit --amend" to amend the current commit)
354
420
(use "git rebase --continue" once you are satisfied with your changes)
@@ -366,12 +432,21 @@ test_expect_success 'status: (amend first edit) second edit and split' '
366
432
export FAKE_LINES &&
367
433
test_when_finished "git rebase --abort" &&
368
434
ONTO=$(git rev-parse --short HEAD~3) &&
435
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
436
+ COMMIT3=$(git rev-parse --short several_edits^) &&
437
+ COMMIT4=$(git rev-parse --short several_edits) &&
369
438
git rebase -i HEAD~3 &&
370
439
git commit --amend -m "b" &&
371
440
git rebase --continue &&
372
441
git reset HEAD^ &&
373
442
cat >expected <<EOF &&
374
443
interactive rebase in progress; onto $ONTO
444
+ Last commands done (2 commands done):
445
+ edit $COMMIT2 two_edits
446
+ edit $COMMIT3 three_edits
447
+ Next command to do (1 remaining command):
448
+ pick $COMMIT4 four_edits
449
+ (use "git rebase --edit-todo" to view and edit)
375
450
You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
376
451
(Once your working directory is clean, run "git rebase --continue")
377
452
@@ -393,13 +468,22 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
393
468
FAKE_LINES="edit 1 edit 2 3" &&
394
469
export FAKE_LINES &&
395
470
test_when_finished "git rebase --abort" &&
471
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
472
+ COMMIT3=$(git rev-parse --short several_edits^) &&
473
+ COMMIT4=$(git rev-parse --short several_edits) &&
396
474
ONTO=$(git rev-parse --short HEAD~3) &&
397
475
git rebase -i HEAD~3 &&
398
476
git commit --amend -m "c" &&
399
477
git rebase --continue &&
400
478
git commit --amend -m "d" &&
401
479
cat >expected <<EOF &&
402
480
interactive rebase in progress; onto $ONTO
481
+ Last commands done (2 commands done):
482
+ edit $COMMIT2 two_edits
483
+ edit $COMMIT3 three_edits
484
+ Next command to do (1 remaining command):
485
+ pick $COMMIT4 four_edits
486
+ (use "git rebase --edit-todo" to view and edit)
403
487
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
404
488
(use "git commit --amend" to amend the current commit)
405
489
(use "git rebase --continue" once you are satisfied with your changes)
@@ -416,6 +500,9 @@ test_expect_success 'status: (split first edit) second edit' '
416
500
FAKE_LINES="edit 1 edit 2 3" &&
417
501
export FAKE_LINES &&
418
502
test_when_finished "git rebase --abort" &&
503
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
504
+ COMMIT3=$(git rev-parse --short several_edits^) &&
505
+ COMMIT4=$(git rev-parse --short several_edits) &&
419
506
ONTO=$(git rev-parse --short HEAD~3) &&
420
507
git rebase -i HEAD~3 &&
421
508
git reset HEAD^ &&
@@ -424,6 +511,12 @@ test_expect_success 'status: (split first edit) second edit' '
424
511
git rebase --continue &&
425
512
cat >expected <<EOF &&
426
513
interactive rebase in progress; onto $ONTO
514
+ Last commands done (2 commands done):
515
+ edit $COMMIT2 two_edits
516
+ edit $COMMIT3 three_edits
517
+ Next command to do (1 remaining command):
518
+ pick $COMMIT4 four_edits
519
+ (use "git rebase --edit-todo" to view and edit)
427
520
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
428
521
(use "git commit --amend" to amend the current commit)
429
522
(use "git rebase --continue" once you are satisfied with your changes)
@@ -440,6 +533,9 @@ test_expect_success 'status: (split first edit) second edit and split' '
440
533
FAKE_LINES="edit 1 edit 2 3" &&
441
534
export FAKE_LINES &&
442
535
test_when_finished "git rebase --abort" &&
536
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
537
+ COMMIT3=$(git rev-parse --short several_edits^) &&
538
+ COMMIT4=$(git rev-parse --short several_edits) &&
443
539
ONTO=$(git rev-parse --short HEAD~3) &&
444
540
git rebase -i HEAD~3 &&
445
541
git reset HEAD^ &&
@@ -449,6 +545,12 @@ test_expect_success 'status: (split first edit) second edit and split' '
449
545
git reset HEAD^ &&
450
546
cat >expected <<EOF &&
451
547
interactive rebase in progress; onto $ONTO
548
+ Last commands done (2 commands done):
549
+ edit $COMMIT2 two_edits
550
+ edit $COMMIT3 three_edits
551
+ Next command to do (1 remaining command):
552
+ pick $COMMIT4 four_edits
553
+ (use "git rebase --edit-todo" to view and edit)
452
554
You are currently splitting a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
453
555
(Once your working directory is clean, run "git rebase --continue")
454
556
@@ -470,6 +572,9 @@ test_expect_success 'status: (split first edit) second edit and amend' '
470
572
FAKE_LINES="edit 1 edit 2 3" &&
471
573
export FAKE_LINES &&
472
574
test_when_finished "git rebase --abort" &&
575
+ COMMIT2=$(git rev-parse --short several_edits^^) &&
576
+ COMMIT3=$(git rev-parse --short several_edits^) &&
577
+ COMMIT4=$(git rev-parse --short several_edits) &&
473
578
ONTO=$(git rev-parse --short HEAD~3) &&
474
579
git rebase -i HEAD~3 &&
475
580
git reset HEAD^ &&
@@ -479,6 +584,12 @@ test_expect_success 'status: (split first edit) second edit and amend' '
479
584
git commit --amend -m "h" &&
480
585
cat >expected <<EOF &&
481
586
interactive rebase in progress; onto $ONTO
587
+ Last commands done (2 commands done):
588
+ edit $COMMIT2 two_edits
589
+ edit $COMMIT3 three_edits
590
+ Next command to do (1 remaining command):
591
+ pick $COMMIT4 four_edits
592
+ (use "git rebase --edit-todo" to view and edit)
482
593
You are currently editing a commit while rebasing branch ' \' ' several_edits' \' ' on ' \' ' $ONTO' \' ' .
483
594
(use "git commit --amend" to amend the current commit)
484
595
(use "git rebase --continue" once you are satisfied with your changes)
0 commit comments