Re: [PATCH v2] format-patch --signature-file

2014-05-20 Thread Jeremiah Mahler
On Tue, May 20, 2014 at 08:06:50AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > You could do: > > > > #define DEFAULT_SIGNATURE git_version_string > > static const char *signature = DEFAULT_SIGNATURE; > > > > ... > > > > if (signature == DEFAULT_SIGNATURE) > > ... > > > > b

Re: [PATCH v2] format-patch --signature-file

2014-05-20 Thread Junio C Hamano
Jeff King writes: > You could do: > > #define DEFAULT_SIGNATURE git_version_string > static const char *signature = DEFAULT_SIGNATURE; > > ... > > if (signature == DEFAULT_SIGNATURE) > ... > > but maybe that is getting a little unwieldy, considering the scope of > the original proble

Re: [PATCH v2] format-patch --signature-file

2014-05-19 Thread Jeff King
On Mon, May 19, 2014 at 10:46:21PM -0700, Jeremiah Mahler wrote: > > Avoiding that is easy with an indirection, no? Something like this > > at the top: > > > > static const char *the_default_signature = git_version_string; > > static const char *signature = the_default_signature; > > > > an

Re: [PATCH v2] format-patch --signature-file

2014-05-19 Thread Jeremiah Mahler
On Mon, May 19, 2014 at 09:54:33AM -0700, Junio C Hamano wrote: > Jeremiah Mahler writes: > > > On Sat, May 17, 2014 at 06:00:14AM -0400, Jeff King wrote: > >> > > Avoiding that is easy with an indirection, no? Something like this > at the top: > > static const char *the_default_signature =

Re: [PATCH v2] format-patch --signature-file

2014-05-19 Thread Junio C Hamano
Jeremiah Mahler writes: > On Sat, May 17, 2014 at 06:00:14AM -0400, Jeff King wrote: >> >> If you wanted to know whether it was set, I guess you'd have to compare >> it to the default, like: >> >> if (signature_file) { >> if (signature && signature != git_version_string) >>

Re: [PATCH v2] format-patch --signature-file

2014-05-17 Thread Jeremiah Mahler
On Sat, May 17, 2014 at 06:00:14AM -0400, Jeff King wrote: > On Sat, May 17, 2014 at 01:59:11AM -0700, Jeremiah Mahler wrote: > > > > if (signature) { > > > if (signature_file) > > > die("you cannot specify both a signature and a signature-file"); > > > /* otherwise, we already hav

Re: [PATCH v2] format-patch --signature-file

2014-05-17 Thread Jeff King
On Sat, May 17, 2014 at 01:59:11AM -0700, Jeremiah Mahler wrote: > > if (signature) { > > if (signature_file) > > die("you cannot specify both a signature and a signature-file"); > > /* otherwise, we already have the value */ > > } else if (signature_file) { > > struct

Re: [PATCH v2] format-patch --signature-file

2014-05-17 Thread Jeremiah Mahler
On Sat, May 17, 2014 at 03:42:24AM -0400, Jeff King wrote: > On Sat, May 17, 2014 at 12:25:48AM -0700, Jeremiah Mahler wrote: > > > > We have routines for reading directly into a strbuf, which eliminates > > > the need for this 1024-byte limit. We even have a wrapper that can make > > > this much

Re: [PATCH v2] format-patch --signature-file

2014-05-17 Thread Jeff King
On Sat, May 17, 2014 at 12:25:48AM -0700, Jeremiah Mahler wrote: > > We have routines for reading directly into a strbuf, which eliminates > > the need for this 1024-byte limit. We even have a wrapper that can make > > this much shorter: > > > > struct strbuf buf = STRBUF_INIT; > > > > strbu

Re: [PATCH v2] format-patch --signature-file

2014-05-17 Thread Jeremiah Mahler
On Fri, May 16, 2014 at 04:14:45AM -0400, Jeff King wrote: > On Thu, May 15, 2014 at 06:31:21PM -0700, Jeremiah Mahler wrote: ... > > A few questions/comments: > > > +static int signature_file_callback(const struct option *opt, const char > > *arg, > > +

Re: [PATCH v2] format-patch --signature-file

2014-05-16 Thread Jeff King
On Thu, May 15, 2014 at 06:31:21PM -0700, Jeremiah Mahler wrote: > Added feature that allows a signature file to be used with format-patch. > > $ git format-patch --signature-file ~/.signature -1 > > Now signatures with newlines and other special characters can be > easily included. I think t

[PATCH v2] format-patch --signature-file

2014-05-15 Thread Jeremiah Mahler
Added feature that allows a signature file to be used with format-patch. $ git format-patch --signature-file ~/.signature -1 Now signatures with newlines and other special characters can be easily included. Signed-off-by: Jeremiah Mahler --- Documentation/git-format-patch.txt | 7 +++ b

[PATCH v2] format-patch --signature-file

2014-05-15 Thread Jeremiah Mahler
On Tue, May 13, 2014 at 09:07:12AM -0700, Jonathan Nieder wrote: > Hi, > > Jeremiah Mahler wrote: > > > # from a string > > $ git format-patch --signature "from a string" origin > > > > # or from a file > > $ git format-patch --signature ~/.signature origin > > Interesting. But... what