Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-06-03 Thread Paul Tan
On Thu, May 28, 2015 at 4:44 AM, Junio C Hamano wrote: > Paul Tan writes: > >> @@ -17,6 +34,10 @@ struct am_state { >> struct strbuf dir;/* state directory path */ >> int cur; /* current patch number */ >> int last; /* last pa

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-06-03 Thread Paul Tan
On Thu, May 28, 2015 at 6:13 AM, Junio C Hamano wrote: > Paul Tan writes: > >> +static const char *msgnum(const struct am_state *state) >> +{ >> + static struct strbuf fmt = STRBUF_INIT; >> + static struct strbuf sb = STRBUF_INIT; >> + >> + strbuf_reset(&fmt); >> + strbuf_addf(&fm

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Jeff King
On Wed, May 27, 2015 at 01:44:26PM -0700, Junio C Hamano wrote: > Paul Tan writes: > > > @@ -17,6 +34,10 @@ struct am_state { > > struct strbuf dir;/* state directory path */ > > int cur; /* current patch number */ > > int last; /*

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Junio C Hamano
Paul Tan writes: > +static const char *msgnum(const struct am_state *state) > +{ > + static struct strbuf fmt = STRBUF_INIT; > + static struct strbuf sb = STRBUF_INIT; > + > + strbuf_reset(&fmt); > + strbuf_addf(&fmt, "%%0%dd", state->prec); > + > + strbuf_reset(&sb); > +

Re: [PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Junio C Hamano
Paul Tan writes: > @@ -17,6 +34,10 @@ struct am_state { > struct strbuf dir;/* state directory path */ > int cur; /* current patch number */ > int last; /* last patch number */ > + struct strbuf msg;/* commit m

[PATCH/WIP 6/8] am: extract patch, message and authorship with git-mailinfo

2015-05-27 Thread Paul Tan
For the purpose of applying the patch and committing the results, implement extracting the patch data, commit message and authorship from an e-mail message using git-mailinfo. git-mailinfo is run as a separate process, but ideally in the future, we should be be able to access its functionality dir