git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* How does format-patch determine the filename of the patch?
@ 2009-10-15 16:17 Timur Tabi
  2009-10-15 17:48 ` Thomas Rast
  2009-10-15 17:59 ` Robin Rosenberg
  0 siblings, 2 replies; 5+ messages in thread
From: Timur Tabi @ 2009-10-15 16:17 UTC (permalink / raw
  To: git

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?

The reason I ask is that I'm writing a script which calls
git-format-patch to create some patches for post-processing.  So I
need the name of the file that git-format-patch creates so that I can
open it and examine it.  I'd liked to see if there's a way to get the
name of the patch without actually creating the file.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does format-patch determine the filename of the patch?
  2009-10-15 16:17 How does format-patch determine the filename of the patch? Timur Tabi
@ 2009-10-15 17:48 ` Thomas Rast
  2009-10-15 17:59 ` Robin Rosenberg
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Rast @ 2009-10-15 17:48 UTC (permalink / raw
  To: Timur Tabi; +Cc: git

Timur Tabi wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does format-patch determine the filename of the patch?
  2009-10-15 16:17 How does format-patch determine the filename of the patch? Timur Tabi
  2009-10-15 17:48 ` Thomas Rast
@ 2009-10-15 17:59 ` Robin Rosenberg
  2009-10-29 13:05   ` Timur Tabi
  1 sibling, 1 reply; 5+ messages in thread
From: Robin Rosenberg @ 2009-10-15 17:59 UTC (permalink / raw
  To: Timur Tabi; +Cc: git

torsdag 15 oktober 2009 18:17:09 skrev  Timur Tabi:
> 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?
>
> The reason I ask is that I'm writing a script which calls
> git-format-patch to create some patches for post-processing.  So I
> need the name of the file that git-format-patch creates so that I can
> open it and examine it.  I'd liked to see if there's a way to get the
> name of the patch without actually creating the file.

It tells you the names on stdout.

-- robin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does format-patch determine the filename of the patch?
  2009-10-15 17:59 ` Robin Rosenberg
@ 2009-10-29 13:05   ` Timur Tabi
  2009-10-29 13:14     ` Joshua Roys
  0 siblings, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2009-10-29 13:05 UTC (permalink / raw
  To: Robin Rosenberg; +Cc: git

On Thu, Oct 15, 2009 at 12:59 PM, Robin Rosenberg
<robin.rosenberg.lists@dewire.com> wrote:

>> The reason I ask is that I'm writing a script which calls
>> git-format-patch to create some patches for post-processing.  So I
>> need the name of the file that git-format-patch creates so that I can
>> open it and examine it.  I'd liked to see if there's a way to get the
>> name of the patch without actually creating the file.
>
> It tells you the names on stdout.

Is there a way for it to tell me the name on stdout *without* actually
creating the patch?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does format-patch determine the filename of the patch?
  2009-10-29 13:05   ` Timur Tabi
@ 2009-10-29 13:14     ` Joshua Roys
  0 siblings, 0 replies; 5+ messages in thread
From: Joshua Roys @ 2009-10-29 13:14 UTC (permalink / raw
  To: Timur Tabi; +Cc: Robin Rosenberg, git

On 10/29/2009 09:05 AM, Timur Tabi wrote:
> On Thu, Oct 15, 2009 at 12:59 PM, Robin Rosenberg
> <robin.rosenberg.lists@dewire.com>  wrote:
>
>>> The reason I ask is that I'm writing a script which calls
>>> git-format-patch to create some patches for post-processing.  So I
>>> need the name of the file that git-format-patch creates so that I can
>>> open it and examine it.  I'd liked to see if there's a way to get the
>>> name of the patch without actually creating the file.
>>
>> It tells you the names on stdout.
>
> Is there a way for it to tell me the name on stdout *without* actually
> creating the patch?
>

Hello,

Is there any way you can just save the names from when you do call 
format-patch?

e.g.
...
my @filenames = qx(git format-patch $opts);
...

Josh

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-29 13:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-15 16:17 How does format-patch determine the filename of the patch? Timur Tabi
2009-10-15 17:48 ` Thomas Rast
2009-10-15 17:59 ` Robin Rosenberg
2009-10-29 13:05   ` Timur Tabi
2009-10-29 13:14     ` Joshua Roys

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).