All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Cc: Git Mailing List <git@vger.kernel.org>,
	Davide Libenzi <davidel@xmailserver.org>
Subject: Re: [PATCH, RFC] diff: add option to show context between close chunks
Date: Mon, 20 Oct 2008 16:43:34 -0700	[thread overview]
Message-ID: <7vabcy3k9l.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <48FB757B.9030105@lsrfire.ath.cx> (René Scharfe's message of "Sun, 19 Oct 2008 19:59:23 +0200")

René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:

> I think it makes sense to make 1, or even 3, the default for this
> option for all commands that create patches intended for human
> consumption.  The patch keeps the default at 0, though.

I think defaulting to 1 would make sense, or alternatively, just
hardcoding that behaviour without any new option.  That would give you
more information with the same number of patch lines, iow, upside without
any downside.

diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index d3d9c84..3bf2581 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -60,9 +60,9 @@ static int xdl_emit_record(xdfile_t *xdf, 
  */
 static xdchange_t *xdl_get_hunk(xdchange_t *xscr, xdemitconf_t const *xecfg) {
 	xdchange_t *xch, *xchp;
 
 	for (xchp = xscr, xch = xscr->next; xch; xchp = xch, xch = xch->next)
-		if (xch->i1 - (xchp->i1 + xchp->chg1) > 2 * xecfg->ctxlen)
+		if (xch->i1 - (xchp->i1 + xchp->chg1) > 2 * xecfg->ctxlen + 1)
 			break;
 
 	return xchp;

  parent reply	other threads:[~2008-10-20 23:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-19 17:59 [PATCH, RFC] diff: add option to show context between close chunks René Scharfe
2008-10-20 14:32 ` Johannes Sixt
2008-10-20 18:06   ` René Scharfe
2008-10-21  6:09     ` Johannes Sixt
2008-10-21 20:45       ` René Scharfe
2008-10-20 23:43 ` Junio C Hamano [this message]
2008-10-21  6:35   ` Johannes Sixt
2008-10-21  7:12     ` Junio C Hamano
2008-10-21 11:20       ` Jeff King
2008-10-21 20:48         ` René Scharfe
2008-10-21 18:16     ` Daniel Barkalow

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=7vabcy3k9l.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=davidel@xmailserver.org \
    --cc=git@vger.kernel.org \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.