Re: [PATCH] Introduce a hook to run after formatting patches

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Introduce a hook to run after formatting patches

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:02:57

Stefan Beller [off-list ref] writes:
+post-format-patch
+~~~~~~~~~~~~
+
+This hook is called after format-patch created a patch and it is 
+invoked with the filename of the patch as the first parameter.
Such an interface would not work well with --stdout mode, would it?

And if this only works with output generated into the files, then

    $ git format-patch $range | xargs -n1 $your_post_processing_script

would do the same without any change to Git, I would imagine.

So I would have to say that I am fairly negative on this change in
the presented form.

An alternative design to implement this as a post-processing filter
to work for both "to individual files" and "to standard output
stream" output filter may be possible, but even in that case I am
not sure if it is worth the churn.

In general I'd look at post-anything hook that works locally with a
great suspicion, so that may partly be where my comment above is
coming from.  I dunno.

Re: [PATCH] Introduce a hook to run after formatting patches

From: Stefan Beller <hidden>
Date: 2016-06-15 23:02:57

On Sun, Nov 16, 2014 at 10:40 AM, Junio C Hamano [off-list ref] wrote:
Stefan Beller [off-list ref] writes:
quoted
+post-format-patch
+~~~~~~~~~~~~
+
+This hook is called after format-patch created a patch and it is
+invoked with the filename of the patch as the first parameter.
Such an interface would not work well with --stdout mode, would it?

And if this only works with output generated into the files, then

    $ git format-patch $range | xargs -n1 $your_post_processing_script

would do the same without any change to Git, I would imagine.
Ok I'll try to use these commands.
So I would have to say that I am fairly negative on this change in
the presented form.
Ok, I definitely did not expect this patch to be accepted the way it is,
but rather was just proposing an idea. The post-format-patch.sample
hook file would be missing for example.
An alternative design to implement this as a post-processing filter
to work for both "to individual files" and "to standard output
stream" output filter may be possible, but even in that case I am
not sure if it is worth the churn.

In general I'd look at post-anything hook that works locally with a
great suspicion, so that may partly be where my comment above is
coming from.  I dunno.
Git is very easy to use when importing from other VCS, because of all
the helpers like high level git-svn or low level fast-import.

Patches on mailing lists can also be easily imported as a commit,
so I think having an exporting system in place with various options
like custom post processing would help for some use cases.

Anyway I'll just drop this patch and go with your suggestion.

Thanks,
Stefan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help