`git rebase -i --rebase-merges` formatting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

for the following commits:

``` git log
*   4fd94fd  (HEAD -> master) 6 hours ago Jan Christoph Uhde Merge branch 'b_two'
|\
| * cc75466  6 hours ago Jan Christoph Uhde b_two
|/
*   9ad8a2b  6 hours ago Jan Christoph Uhde Merge branch 'b_one'
|\
| * b23658f  (b_one) 6 hours ago Jan Christoph Uhde one
|/
* a9d65bc  6 hours ago Jan Christoph Uhde initial commit
```

I get a this merge script when rebasing onto the initial commit.

``` actual merge script
  1 label onto
  2
  3 # Branch b-one
  4 reset onto
  5 pick b23658f one
  6 label b-one
  7
  8 # Branch b-two
  9 reset onto
 10 merge -C 9ad8a2b b-one # Merge branch 'b_one'
 11 label branch-point
 12 pick cc75466 b_two
 13 label b-two
 14
 15 reset branch-point # Merge branch 'b_one'
 16 merge -C 4fd94fd b-two # Merge branch 'b_two'
 17
 18 # Rebase a9d65bc..4fd94fd onto a9d65bc (11 commands)
 19 #
```

I think it should be more similar to this:


``` suggested merge script
  1 label onto
  2 reset onto #Could imo go but probably avoids special cases
  3
  4 # Branch b-one
  5 pick b23658f one
  6 label b-one
  7 reset onto
  8 merge -C 9ad8a2b b-one # Merge branch 'b_one'
  9 label branch-point
 10
 11 # Branch b-two
 12 pick cc75466 b_two
 13 label b-two
 14 reset branch-point # Merge branch 'b_one'
 15 merge -C 4fd94fd b-two # Merge branch 'b_two'
 16 # add `label branch-point-1` here to avoid special cases?!
 17
 18 # Rebase a9d65bc..4fd94fd onto a9d65bc (11 commands)
 19 #
```


Looking at the sequencer.c it might not be worth the invested time
to change the format. If it can not be resolved easily I think
removing the empty lines and the branch-comments would suffice
to reduce the confusion. I think they have been introduced to
help people but here they are a hindrance.

Another unrelated suggestion is to start with `branch-point-0`
instead of `onto` and keep counting up. This would make the
edit-distances smaller when you fiddle with the first commits.

Regards

Jan





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux