{"thread":{"id":"21249","subject":"How does format-patch determine the filename of the patch?","startedAt":"2009-10-15T16:17:09Z","lastAt":"2009-10-29T13:14:48Z","messageCount":5,"participants":["Timur Tabi","Thomas Rast","Robin Rosenberg","Joshua Roys"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125081","messageId":"ed82fe3e0910150917u72ef189epc74411e71a9cd2d4@mail.gmail.com","threadId":"21249","inReplyTo":null,"subject":"How does format-patch determine the filename of the patch?","fromName":"Timur Tabi","fromEmail":"timur@freescale.com","sentAt":"2009-10-15T16:17:09Z","receivedAt":"2009-10-15T16:17:09Z","isPatch":false,"sender":{"key":"timur@freescale.com","avatar":null},"body":"Hi.  I'm not familiar with the git source code, so forgive me if this\nis a dumb question.  I'm trying to determine the algorithm that\ngit-format-patch uses to determine the name of the patch file it\ncreates (e.g. \"0001-this-is-my-patch-without-spaces-and-trunca.patch\")\n I'm looking at the function cmd_format_patch(), and I just don't see\nwhere it creates any files.  Can someone show me where this code is?\n\nThe reason I ask is that I'm writing a script which calls\ngit-format-patch to create some patches for post-processing.  So I\nneed the name of the file that git-format-patch creates so that I can\nopen it and examine it.  I'd liked to see if there's a way to get the\nname of the patch without actually creating the file.\n\n-- \nTimur Tabi\nLinux kernel developer at Freescale\n"},{"id":"125090","messageId":"200910151948.48539.trast@student.ethz.ch","threadId":"21249","inReplyTo":"ed82fe3e0910150917u72ef189epc74411e71a9cd2d4@mail.gmail.com","subject":"Re: How does format-patch determine the filename of the patch?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-10-15T17:48:47Z","receivedAt":"2009-10-15T17:48:47Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Timur Tabi wrote:\n> Hi.  I'm not familiar with the git source code, so forgive me if this\n> is a dumb question.  I'm trying to determine the algorithm that\n> git-format-patch uses to determine the name of the patch file it\n> creates (e.g. \"0001-this-is-my-patch-without-spaces-and-trunca.patch\")\n>  I'm looking at the function cmd_format_patch(), and I just don't see\n> where it creates any files.  Can someone show me where this code is?\n\nget_patch_filename() in log-tree.c, but the bulk of the work is done\nin the call out to format_commit_message() [pretty.c] with the \"%f\"\nformat, which is in turn handled by format_sanitized_subject()\n[pretty.c].\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"125092","messageId":"200910151959.47778.robin.rosenberg.lists@dewire.com","threadId":"21249","inReplyTo":"ed82fe3e0910150917u72ef189epc74411e71a9cd2d4@mail.gmail.com","subject":"Re: How does format-patch determine the filename of the patch?","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2009-10-15T17:59:47Z","receivedAt":"2009-10-15T17:59:47Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"torsdag 15 oktober 2009 18:17:09 skrev  Timur Tabi:\n> Hi.  I'm not familiar with the git source code, so forgive me if this\n> is a dumb question.  I'm trying to determine the algorithm that\n> git-format-patch uses to determine the name of the patch file it\n> creates (e.g. \"0001-this-is-my-patch-without-spaces-and-trunca.patch\")\n>  I'm looking at the function cmd_format_patch(), and I just don't see\n> where it creates any files.  Can someone show me where this code is?\n>\n> The reason I ask is that I'm writing a script which calls\n> git-format-patch to create some patches for post-processing.  So I\n> need the name of the file that git-format-patch creates so that I can\n> open it and examine it.  I'd liked to see if there's a way to get the\n> name of the patch without actually creating the file.\n\nIt tells you the names on stdout.\n\n-- robin\n"},{"id":"126268","messageId":"ed82fe3e0910290605j302747f9o6a86acb414427639@mail.gmail.com","threadId":"21249","inReplyTo":"200910151959.47778.robin.rosenberg.lists@dewire.com","subject":"Re: How does format-patch determine the filename of the patch?","fromName":"Timur Tabi","fromEmail":"timur@freescale.com","sentAt":"2009-10-29T13:05:21Z","receivedAt":"2009-10-29T13:05:21Z","isPatch":false,"sender":{"key":"timur@freescale.com","avatar":null},"body":"On Thu, Oct 15, 2009 at 12:59 PM, Robin Rosenberg\n<robin.rosenberg.lists@dewire.com> wrote:\n\n>> The reason I ask is that I'm writing a script which calls\n>> git-format-patch to create some patches for post-processing.  So I\n>> need the name of the file that git-format-patch creates so that I can\n>> open it and examine it.  I'd liked to see if there's a way to get the\n>> name of the patch without actually creating the file.\n>\n> It tells you the names on stdout.\n\nIs there a way for it to tell me the name on stdout *without* actually\ncreating the patch?\n\n-- \nTimur Tabi\nLinux kernel developer at Freescale\n"},{"id":"126269","messageId":"4AE99548.5060100@gmail.com","threadId":"21249","inReplyTo":"ed82fe3e0910290605j302747f9o6a86acb414427639@mail.gmail.com","subject":"Re: How does format-patch determine the filename of the patch?","fromName":"Joshua Roys","fromEmail":"roysjosh@gmail.com","sentAt":"2009-10-29T13:14:48Z","receivedAt":"2009-10-29T13:14:48Z","isPatch":false,"sender":{"key":"roysjosh@gmail.com","avatar":null},"body":"On 10/29/2009 09:05 AM, Timur Tabi wrote:\n> On Thu, Oct 15, 2009 at 12:59 PM, Robin Rosenberg\n> <robin.rosenberg.lists@dewire.com>  wrote:\n>\n>>> The reason I ask is that I'm writing a script which calls\n>>> git-format-patch to create some patches for post-processing.  So I\n>>> need the name of the file that git-format-patch creates so that I can\n>>> open it and examine it.  I'd liked to see if there's a way to get the\n>>> name of the patch without actually creating the file.\n>>\n>> It tells you the names on stdout.\n>\n> Is there a way for it to tell me the name on stdout *without* actually\n> creating the patch?\n>\n\nHello,\n\nIs there any way you can just save the names from when you do call \nformat-patch?\n\ne.g.\n...\nmy @filenames = qx(git format-patch $opts);\n...\n\nJosh\n"}]}