git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Stefan Beller <sbeller@google.com>
Date
Nov 17, 2014, 19:01 UTC
Message-ID
<CAGZ79kZsK=hkSOCnR75eDYauOt-biCD6_v0eH3Ls_Krb_UAAvQ@mail.gmail.com>
In-Reply-To
<xmqqzjbryonp.fsf@gitster.dls.corp.google.com>
On Sun, Nov 16, 2014 at 10:40 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Stefan Beller <sbeller@google.com> 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.
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.

Show 10 quoted lines
>
> 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

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 12 in “Introduce a hook to run after formatting patches”
  1. Introduce a hook to run after formatting patchesStefan Beller, Nov 15, 2014
  2. Philip OakleyNov 15, 2014
  3. Junio C HamanoNov 16, 2014
  4. Stefan BellerNov 17, 2014
  5. Junio C HamanoNov 17, 2014
  6. Junio C HamanoNov 17, 2014
  7. Christian CouderNov 18, 2014
  8. Stefan BellerNov 20, 2014
  9. Junio C HamanoNov 20, 2014
  10. Christian CouderNov 21, 2014
  11. Stefan BellerNov 18, 2014
  12. Junio C HamanoNov 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.