[PATCH V2] convert: config option to control Git committer actions

Gregory Szorc gregory.szorc at gmail.com
Sat Jan 14 13:05:08 EST 2017


On Sat, Jan 14, 2017 at 5:53 AM, Yuya Nishihara <yuya at tcha.org> wrote:

> On Fri, 13 Jan 2017 23:21:23 -0800, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1484378470 28800
> > #      Fri Jan 13 23:21:10 2017 -0800
> > # Node ID 3cfb4ac1f3c79e876238855822a88da1b199da99
> > # Parent  8614546154cbffe8df6a56d53e404491fa092636
> > convert: config option to control Git committer actions
>
> Looks good. Queued this, thanks.
>
> > @@ -327,6 +327,39 @@ def convert(ui, src, dest=None, revmapfi
> >          ``convert.git.similarity`` is greater than 0. The default is
> >          ``400``.
> >
> > +    :convert.git.committeractions: list of actions to take when
> processing
> > +        author and committer values.
> > +
> > +        Git commits have separate author (who wrote the commit) and
> committer
> > +        (who applied the commit) fields. Not all destinations support
> separate
> > +        author and committer fields (including Mercurial). This config
> option
> > +        controls what to do with these author and committer fields
> during
> > +        conversion.
> > +
> > +        A value of ``messagedifferent`` will append a ``committer: ...``
> > +        line to the commit message if the Git committer is different
> from the
> > +        author. The prefix of that line can be specified using the
> syntax
> > +        ``messagedifferent=<prefix>``. e.g.
> ``messagedifferent=git-committer:``.
> > +        When a prefix is specified, a space will always be inserted
> between the
> > +        prefix and the value.
> > +
> > +        ``messagealways`` behaves like ``messagedifferent`` except it
> will
> > +        always result in a ``committer: ...`` line being appended to
> the commit
> > +        message. This value is mutually exclusive with
> ``messagedifferent``.
> > +
> > +        ``dropcommitter`` will remove references to the committer. Only
> > +        references to the author will remain. Actions that add
> references
> > +        to the committer will have no effect when this is set.
> > +
> > +        ``replaceauthor`` will replace the value of the author field
> with
> > +        the committer. Other actions that add references to the
> committer
> > +        will still take effect when this is set.
> > +
> > +        ``replacecommitter`` will replace the value of the committer
> field
> > +        with the author.
> > +
> > +        The default is ``messagewhendifferent``.
>
> I did s/messagewhendifferent/messagedifferent/ in flight.
>
> BTW, I'm a bit curious how replacecommitter could be used.
>

Good question! I implemented it out of a habit for completeness. I don't
really see a compelling use case for it. I'll try to send a follow-up patch
to remove it in the next few hours.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170114/9af0d128/attachment.html>


More information about the Mercurial-devel mailing list