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

Re: How does format-patch determine the filename of the patch?

From
Thomas Rast <trast@student.ethz.ch>
Date
Oct 15, 2009, 17:48 UTC
Message-ID
<200910151948.48539.trast@student.ethz.ch>
In-Reply-To
<ed82fe3e0910150917u72ef189epc74411e71a9cd2d4@mail.gmail.com>
Timur Tabi wrote:
Show 6 quoted lines
> Hi.  I'm not familiar with the git source code, so forgive me if this
> is a dumb question.  I'm trying to determine the algorithm that
> git-format-patch uses to determine the name of the patch file it
> creates (e.g. "0001-this-is-my-patch-without-spaces-and-trunca.patch")
>  I'm looking at the function cmd_format_patch(), and I just don't see
> where it creates any files.  Can someone show me where this code is?

get_patch_filename() in log-tree.c, but the bulk of the work is done in the call out to format_commit_message() [pretty.c] with the "%f" format, which is in turn handled by format_sanitized_subject() [pretty.c].

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Timur TabiNext: Robin Rosenberg
Message 2 of 5 in “How does format-patch determine the filename of the patch?”
  1. Timur TabiOct 15, 2009
  2. Thomas RastOct 15, 2009
  3. Robin RosenbergOct 15, 2009
  4. Timur TabiOct 29, 2009
  5. Joshua RoysOct 29, 2009

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.