git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "Kristian Høgsberg" <krh@redhat.com>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH v2] builtin-commit: Include the diff in the commit message when verbose.
Date: Thu, 22 Nov 2007 10:52:04 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711221049350.27959@racer.site> (raw)
In-Reply-To: <1195700089-8326-1-git-send-email-krh@redhat.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 834 bytes --]

Hi,

On Wed, 21 Nov 2007, Kristian Høgsberg wrote:

> @@ -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

  reply	other threads:[~2007-11-22 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22  2:54 [PATCH v2] builtin-commit: Include the diff in the commit message when verbose Kristian Høgsberg
2007-11-22 10:52 ` Johannes Schindelin [this message]
2007-11-22 11:13   ` Jeff King
2007-11-22 19:14   ` Junio C Hamano
2007-11-26 15:21     ` Kristian Høgsberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711221049350.27959@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=krh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).