Re: [PATCH v2] builtin-commit: Include the diff in the commit message when verbose.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 22, 2007, 10:52 UTC
- Message-ID
- <Pine.LNX.4.64.0711221049350.27959@racer.site>
- In-Reply-To
- <1195700089-8326-1-git-send-email-krh@redhat.com>
Hi,
On Wed, 21 Nov 2007, Kristian Høgsberg wrote:
Show 10 quoted lines
> @@ -758,6 +758,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix) > rollback_index_files(); > exit(1); > } > + > + /* Truncate the message just before the diff, if any. */ > + p = strstr(sb.buf, "\ndiff --git a/"); > + if (p != NULL) > + strbuf_setlen(&sb, p - sb.buf); > +
Is this related to the change in wt_status? If so, wouldn't we want to suppress the diff, instead of generating it, and then killing it later?
Besides, you'd want to leave the \n there: strbuf_setlen(&sb, p + 1 - sb.buf);
> + /* Sigh, the entire diff machinery is hardcoded to output to > + * stdout. Do the dup-dance...*/
I wonder how much effort it would be to change that. Not that it would help too much, since we want the output in a strbuf anyway.
Ciao, Dscho