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

2013-12-05 Thread Junio C Hamano
Jens Lehmann writes: > + fprintf(s->fp, "%c %s", comment_line_char, cut_line); > + strbuf_add_commented_lines(&buf, explanation, > strlen(explanation)); > + fprintf(s->fp, buf.buf); This is better done with: fputs(buf.buf, s->fp); Already locally tw

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

2013-12-05 Thread Junio C Hamano
Jens Lehmann writes: > 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

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

2013-12-05 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