On Thu, Nov 29, 2018 at 10:47 PM Emilio Cobos Álvarez <emi...@crisal.io>
wrote:

> On 11/30/18 2:06 AM, Ehsan Akhgari wrote:
> > On Thu, Nov 29, 2018 at 9:43 AM Emilio Cobos Álvarez <emi...@crisal.io>
> > wrote:
> >
> >> On 11/29/18 1:38 PM, Sylvestre Ledru wrote:
> >>> This extension will automatically rebase the local changes to avoid
> >>> conflicts.
> >>
> >> Is there a way to do the same for cinnabar users?
> >>
> >
> > Yes!  Sorry for the delay...
>
> NP!
>
> > Please check out this script:
> > https://github.com/ehsan/clang-format-reformat-branch.  This does
> something
> > similar to the format-source extension for Mercurial but done as a
> one-time
> > tool, borrowing from the tool that the MongoDB project developed for the
> > same use case.  It takes a local branch based on a clone of
> mozilla-central
> > that doesn't yet have the reformat commit and rebases it on top of the
> > reformat commit, reformatting your local modifications in the process.  I
> > hope it proves to be helpful for the git users out there!
>
> Nice! I haven't tried it yet (actually was going to report back when I
> found the reply).
>
> I hacked up something today as well while looking into this. It's not
> really sophisticated, and you need to tweak the git repo config, so your
> script probably works best for most people.
>
> Just in case it's useful for somebody, while looking into a way to do
> this (I basically followed[1]), I wrote a little merge driver which
> seems to work fine (with a caveat, see below). I just uploaded it here:
>
>    https://github.com/emilio/clang-format-merge
>

This actually looks quite decent, and a cleaner approach.  It also taught
me about merge drivers.  :-)  I suspect this would work equally well for
everyone (but I haven't tested it myself, just based on reading the source.)

Thanks for making it happen.

-- 
Ehsan
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to