git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Kristian HøgsbergNext: Jeff King
Message 2 of 5 in “builtin-commit: Include the diff in the commit message when verbose.”
  1. builtin-commit: Include the diff in the commit message when verbose.Kristian Høgsberg, Nov 22, 2007
  2. Johannes SchindelinNov 22, 2007
  3. Jeff KingNov 22, 2007
  4. Junio C HamanoNov 22, 2007
  5. Kristian HøgsbergNov 26, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.