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

Re: [PATCH master] expand "<branch>" in format.subjectprefix

From
Jeff King <peff@peff.net>
Date
Jan 13, 2010, 20:29 UTC
Message-ID
<20100113202930.GC23018@coredump.intra.peff.net>
In-Reply-To
<1263402988-925-1-git-send-email-rep.dot.nop@gmail.com>
On Wed, Jan 13, 2010 at 06:16:28PM +0100, Bernhard Reutner-Fischer wrote:
Show 6 quoted lines
> Replace "<branch>" with the current branch name for
> [format]
>         subjectprefix = PATCH <branch>
> 
> A subject-prefix given on the command-line overrides the one given in
> the config.

I don't have a big opinion on whether this feature is useful (it wouldn't be to me, but I can see workflows where it could be).

I'm not sure that "current branch" makes sense, though. format-patch is about showing commits, and the current branch is not a property of that commit. It is about where you happen to be currently. So doing:

  git checkout X
  git format-patch Y..Z --subject-prefix "PATCH <branch>"

shows "X" which is not really useful information. Something like git log's "--source" would be more useful; it shows the command-line ref that was used to reach a given commit.

Also, please don't introduce a new substitution syntax. We already have code to do %-expansion. In fact, if you are going to do something like this, maybe it would be best as two patches:

  1. Support '%B' as a user-format expansion for the --source branch.
  2. Support user-format expansions in the subject prefix.

But I don't know if people would find any of the other substitutions useful in the subject line.

-Peff
Previous: Bernhard Reutner-Fischer
Message 2 of 2 in “expand "<branch>" in format.subjectprefix”
  1. expand "<branch>" in format.subjectprefixBernhard Reutner-Fischer, Jan 13, 2010
  2. Jeff KingJan 13, 2010

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.