[PATCH 3 of 3] patchbomb: make --git-format-patch imply --plain

Sean Farley sean at farley.io
Wed Nov 30 14:17:02 EST 2016


Henning Schild <henning at hennsch.de> writes:

> Am Thu, 24 Nov 2016 15:42:58 +0000
> schrieb Jun Wu <quark at fb.com>:
>
>> What do you think about Sean's idea mentioned earlier? Implement the
>> logic in the hg-git extension. And let the hg-git extension check if
>> the repo is a hg-git repo or not. We can also have a boolean
>> repo-level config option.
>
> That sounds like a good idea but i am afraid it would be very hard to
> hook into "hg email" from hg-git. As far as i understand hg-git, it
> deals only with the conversion of changesets or objects. And it does
> not really hook into core hg, like hg email.
> I guess if email was using templates it would be easy to ship another
> template with hg-git and pick it when on git.
>
> Please correct me if i am wrong and suggest a minimal intrusive/hacky
> way to implement the changes in hg-git.

No, hg-git very much digs into the internals of hg. Here is a minimal
example (debugger left in for tutorial purposes) of overriding
`makepatch' for repos with .hg/git:

https://bitbucket.org/seanfarley/hg-git/commits/348c8ff0494d90fe46384eddecbe2676e68ec80f

Hopefully, it's clear that this example modifies patchlines then sends
it to the original (i.e. Mercurial's) `makepatch' method.


More information about the Mercurial-devel mailing list