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

3 messages, 3 authors, 2016-08-11 · 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

Junio C Hamano [off-list ref] writes:
(I am not saying that there should be an easy way to drop cruft left
by third-party systems such as "Change-id:" line) ...
Heh, that was "should not be", but I guess it was probably obvious.

Sorry for the noise.

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

From: Christian Couder <hidden>
Date: 2016-06-15 23:02:58

On Mon, Nov 17, 2014 at 8:20 PM, Junio C Hamano [off-list ref] wrote:
Junio C Hamano [off-list ref] writes:
quoted
(I am not saying that there should be an easy way to drop cruft left
by third-party systems such as "Change-id:" line) ...
Heh, that was "should not be", but I guess it was probably obvious.

Sorry for the noise.
I am not sure it is very easy yet but as Change-id: ... line are
trailers, you can do that with git interpret-trailers.

For example:

$ echo -e "\nChange-id: stuff\nOther: thing"  | git -c
trailer.Change-id.ifexists=replace interpret-trailers --trim-empty
--trailer Change-id=
Other: thing
The idea is that the above command replaces an existing "Change-id:
stuff" trailer with an empty "Change-id:" trailer and then removes all
the empty trailers.

Best,
Christian.

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

From: Stefan Beller <hidden>
Date: 2016-08-11 17:46:22

On Tue, Nov 18, 2014 at 07:40:07AM +0100, Christian Couder wrote:
On Mon, Nov 17, 2014 at 8:20 PM, Junio C Hamano [off-list ref] wrote:
quoted
Junio C Hamano [off-list ref] writes:
quoted
(I am not saying that there should be an easy way to drop cruft left
by third-party systems such as "Change-id:" line) ...
Heh, that was "should not be", but I guess it was probably obvious.

Sorry for the noise.
I am not sure it is very easy yet but as Change-id: ... line are
trailers, you can do that with git interpret-trailers.

For example:

$ echo -e "\nChange-id: stuff\nOther: thing"  | git -c
trailer.Change-id.ifexists=replace interpret-trailers --trim-empty
--trailer Change-id=
quoted
Other: thing
The idea is that the above command replaces an existing "Change-id:
stuff" trailer with an empty "Change-id:" trailer and then removes all
the empty trailers.
So I have read the man page on the trailers and it seems like the solution
to my problem in removing parts from the commit message.
However I did not find out, if it can be run automatically, whenever
calling format-patch

Maybe all that is missing here is an option

	git config format.enable_trailers 
?

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