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

Re: Including branch info in git format-patch

From
Jeff King <peff@peff.net>
Date
Jun 19, 2008, 20:28 UTC
Message-ID
<20080619202843.GA6207@sigill.intra.peff.net>
In-Reply-To
<20080619154251.GA16475@jurassic>
On Thu, Jun 19, 2008 at 09:12:52PM +0530, Mukund Sivaraman wrote:
Show 5 quoted lines
> When i use "git format-patch", it doesn't seem to include the branch (or
> remote) name in the email it creates. So a reader of this mail may not
> know what branch to apply it on to test it. Aside from adding in branch
> information manually in the body of the message, is there any other
> existing way to get git format-patch to include it?

No, there isn't a way to do it automatically. On this mailing list, patches are assumed to be on top of "master" unless explicitly indicated otherwise. And we usually just mention it manually.

You could potentially add a config option to put the branch name inside the '[PATCH]' text. This text is generally stripped away before applying, so it would still free up the receiver to apply on whatever branch they wanted. I don't think it would make sense for git development, since we typically use topic branches, so keeping it configurable would make sense.

On the receiving end, the applying party could set up their MUA to split patches based on the subject, and then apply them as appropriate (this very much depends on their workflow for applying patches). You could probably even do a pre-applypatch hook as a safety valve to make sure things were being applied in the right place.

-Peff
Previous: Mukund SivaramanNext: Junio C Hamano
Message 2 of 9 in “Including branch info in git format-patch”
  1. Mukund SivaramanJun 19, 2008
  2. Jeff KingJun 19, 2008
  3. Junio C HamanoJun 19, 2008
  4. Jeff KingJun 19, 2008
  5. Jeff KingJun 19, 2008
  6. Sverre RabbelierJun 19, 2008
  7. Mukund SivaramanJun 19, 2008
  8. Junio C HamanoJun 19, 2008
  9. Mukund SivaramanJun 19, 2008

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.