From: Junio C Hamano <junkio@cox.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-diff: fix combined diff
Date: Thu, 22 Feb 2007 22:09:45 -0800 [thread overview]
Message-ID: <7v3b4xbe1i.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vbqjlbg8y.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 22 Feb 2007 21:22:05 -0800")
Junio C Hamano <junkio@cox.net> writes:
> With this,
>
> $ git diff maint master next pu
>
> starts working as planned ;-).
By the way, your commit log message does not seem to say
why it is a fix correctly. Here is what I replaced it with.
-- >8 -- cut here -- >8 --
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Date: Fri, 23 Feb 2007 05:20:32 +0100
Subject: [PATCH] git-diff: fix combined diff
The code forgets that typecast binds tighter than addition, in
other words:
(cast *)array + i === ((cast *)array) + i
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
builtin-diff.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-diff.c b/builtin-diff.c
index a659020..c387ebb 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -192,7 +192,8 @@ static int builtin_diff_combined(struct rev_info *revs,
parent = xmalloc(ents * sizeof(*parent));
/* Again, the revs are all reverse */
for (i = 0; i < ents; i++)
- hashcpy((unsigned char*)parent + i, ent[ents - 1 - i].item->sha1);
+ hashcpy((unsigned char *)(parent + i),
+ ent[ents - 1 - i].item->sha1);
diff_tree_combined(parent[0], parent + 1, ents - 1,
revs->dense_combined_merges, revs);
return 0;
--
1.5.0.1.619.g04c5c
next prev parent reply other threads:[~2007-02-23 6:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-23 4:20 [PATCH] git-diff: fix combined diff Johannes Schindelin
2007-02-23 5:22 ` Junio C Hamano
2007-02-23 6:09 ` Junio C Hamano [this message]
2007-02-23 5:34 ` Jeff King
2007-02-23 11:19 ` Johannes Schindelin
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=7v3b4xbe1i.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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