Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-23 Thread Ye Xiaolong
On Fri, Apr 22, 2016 at 02:59:42PM -0700, Junio C Hamano wrote: >Xiaolong Ye writes: > >> +test_expect_success 'format-patch --base' ' >> +git checkout side && >> +git format-patch --stdout --base=HEAD~~~ -1 >patch && >> +grep -e "^base-commit:" -A3 patch

Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-23 Thread Ye Xiaolong
On Fri, Apr 22, 2016 at 02:39:28PM -0700, Junio C Hamano wrote: >Xiaolong Ye writes: > >> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh >> index eed2981..a6ce727 100755 >> --- a/t/t4014-format-patch.sh >> +++ b/t/t4014-format-patch.sh >> @@ -1460,4 +1460,19

Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-22 Thread Junio C Hamano
Xiaolong Ye writes: > +test_expect_success 'format-patch --base' ' > + git checkout side && > + git format-patch --stdout --base=HEAD~~~ -1 >patch && > + grep -e "^base-commit:" -A3 patch >actual && The -A3 is GNUism. To do this portably, perhaps you can do

Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-22 Thread Junio C Hamano
Xiaolong Ye writes: > +static struct commit *get_base_commit(const char *base_commit, > + struct commit **list, > + int total) > +{ > + struct commit *base = NULL; > + struct commit **rev; > +

Re: [PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-22 Thread Junio C Hamano
Xiaolong Ye writes: > diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh > index eed2981..a6ce727 100755 > --- a/t/t4014-format-patch.sh > +++ b/t/t4014-format-patch.sh > @@ -1460,4 +1460,19 @@ test_expect_success 'format-patch -o overrides >

[PATCH v5 2/4] format-patch: add '--base' option to record base tree info

2016-04-21 Thread Xiaolong Ye
Maintainers or third party testers may want to know the exact base tree the patch series applies to. Teach git format-patch a '--base' option to record the base tree info and append it at the end of the first message (either the cover letter or the first patch in the series). The base tree info