Re: [PATCH v3] commit -v: strip diffs and submodule shortlogs from the commit message

2013-11-21 Thread Junio C Hamano
Jens Lehmann writes: > But what about this: > > struct strbuf cut_line = STRBUF_INIT; > strbuf_addf(&cut_line, "%c %s", comment_line_char, wt_status_cut_line); > p = strstr(buf->buf, cut_line.buf); > if (p && (p == buf->buf || p[-1] == '\n')) > strbuf_setlen(

Re: [PATCH v3] commit -v: strip diffs and submodule shortlogs from the commit message

2013-11-21 Thread Jens Lehmann
Am 21.11.2013 00:04, schrieb Junio C Hamano: > Jens Lehmann writes: >> diff --git a/wt-status.c b/wt-status.c >> index b4e44ba..734f94b 100644 >> --- a/wt-status.c >> +++ b/wt-status.c >> @@ -16,6 +16,9 @@ >> #include "column.h" >> #include "strbuf.h" >> >> +static char wt_status_cut_line[] = /*

Re: [PATCH v3] commit -v: strip diffs and submodule shortlogs from the commit message

2013-11-20 Thread Junio C Hamano
Jens Lehmann writes: > Changes since v2: > > - Honor the core.commentChar setting and add a test for that. > > - Fix the submodule test to set the editor in a portable way. > > - Only print scissor and description lines when not going to stdout > (otherwise a "git status -v" prints that on stdo

[PATCH v3] commit -v: strip diffs and submodule shortlogs from the commit message

2013-11-20 Thread Jens Lehmann
When using the '-v' option of "git commit" the diff added to the commit message temporarily for editing is stripped off after the user exited the editor by searching for "\ndiff --git " and truncating the commmit message there if it is found. But this approach has two problems: - when the commit