[neomutt-devel] Rebasing the branches

Richard Russon rich at flatcap.org
Fri Apr 14 18:21:36 CEST 2017


Rebasing the branches

Because the underlying code had changed so radically, there was no way
that the branches could be rebased by reapplying the patches.  The
solution was to split out the patches, clang-format them, then
reassemble.

Here's a diagram to explain what I did...

master ---L---O---O---O---O---O---O---CLANG
           \
feature     f1--f2--f3--f4

The master and feature diverged, their "Last Common Ancestor" is marked L.
The clang-formatting is the latest commit

First create a side branch for each of the commits and run clang-format
on the entire source tree in each branch.

       ---L---f1--f2--f3--f4
           \   \   \   \   \
            c0  c1  c2  c3  c4

Next, create diffs from these "formatted" commits:

    git diff c0 c1 > f1.diff
    git diff c1 c2 > f2.diff
    git diff c2 c3 > f3.diff
    git diff c3 c4 > f4.diff

Create a new feature branch from master

master ---L---O---O---O---O---O---O---CLANG
                                        \
feature'                                 .

Now, for each commit, apply the diff and commit using '-C' to reuse
commit messages from f1..f4

master ---L---O---O---O---O---O---O---CLANG
                                        \
feature'                                 f1'--f2'--f3'--f4'

Finally, I tested the build of each of the commits and compared the
diffs from each again the original commit diffs.

Make sense :-)

Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20170414/bab7f5fd/attachment.sig>


More information about the neomutt-devel mailing list