git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: gitweb using "--cc"?
Date: Thu, 09 Feb 2006 14:26:54 -0800	[thread overview]
Message-ID: <7v3bis88y9.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vk6c48a69.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Thu, 09 Feb 2006 14:00:30 -0800")

Junio C Hamano <junkio@cox.net> writes:

> Junio C Hamano <junkio@cox.net> writes:
>
>> On top of your patch, it was quite easy ;-)
>>
>> After the "Evil merge" in your test script, I added these:
>>
>>...
>>
>>         git diff-tree -M --cc HEAD
>
> Sorry for the noise.  The test was broken.

Second try.  Sorry again for the previous noise.

This time I made sure I am getting double-colon output;
here is what I added after your test script:

        for i in a b c d e f g h i j k l m n; do echo $i; done >d
        git-update-index --add d
        git commit -m 'Add d'

        git checkout other
        git merge fast HEAD master

        echo o >>d
        git-update-index d
        git commit -m 'Edit d'

        git checkout master
        echo 'Another' >>a
        git-update-index a
        git commit -m 'Modify a'
        git merge --no-commit 'Merge' HEAD other
        echo Extra >>a
        mv d e
        echo extra >>e
        git update-index --add --remove a d e
        git commit -m 'Evil again'

        git diff-tree -M -c HEAD

But you are right.  Rename detection with combined diff has a
funny semantics:

    diff-tree 9df5f2d... (from parents)
    Merge: 1da47fa... 09eee61...
    Author: Junio C Hamano <junkio@cox.net>
    Date:   Thu Feb 9 14:11:13 2006 -0800

        Evil again

    ::100644 100644 100644 8c3beaf... aad9366... c54c990... M	a
    ::100644 100644 100644 4f7cbe7... f8c295c... 19d5d80... M	e

This is showing that what was "d" was somehow magically called
"e" in the merge result with its own changes.  --cc output is
more interesting but the point is there is no sign of "d" in its
output, which does not feel right.

If we really care, we could show a status letter for each parent
(both are renames in this case but it is plausible one parent is
rename-edit and another is modify) and the original path in each
parent.

Does it matter?  I presume that a Porcelain that cares would
rather use the traditional "diff-tree -m -r" to look at diff
with each parent.  I dunno.

---
diff --git a/combine-diff.c b/combine-diff.c
index 15f369e..6d78305 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -829,7 +829,7 @@ const char *diff_tree_combined_merge(con
 	struct combine_diff_path *p, *paths = NULL;
 	int num_parent, i, num_paths;
 
-	diff_setup(&diffopts);
+	diffopts = *opt;
 	diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
 	diffopts.recursive = 1;
 
@@ -846,6 +846,7 @@ const char *diff_tree_combined_merge(con
 		struct commit *parent = parents->item;
 		diff_tree_sha1(parent->object.sha1, commit->object.sha1, "",
 			       &diffopts);
+		diffcore_std(&diffopts);
 		paths = intersect_paths(paths, i, num_parent);
 		diff_flush(&diffopts);
 	}

  reply	other threads:[~2006-02-09 22:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-08 23:44 gitweb using "--cc"? Linus Torvalds
2006-02-08 23:57 ` Junio C Hamano
2006-02-09  0:01   ` [PATCH] Use describe to come up with the closest tag Junio C Hamano
2006-02-09  0:02   ` [PATCH] Allow using --cc when showing a merge Junio C Hamano
2006-02-09  2:13 ` gitweb using "--cc"? Brian Gerst
2006-02-09  2:26   ` Linus Torvalds
2006-02-09  3:14     ` Junio C Hamano
2006-02-09 16:35       ` Linus Torvalds
2006-02-09 16:42         ` Linus Torvalds
2006-02-09 18:30         ` Linus Torvalds
2006-02-09 19:41           ` Junio C Hamano
2006-02-09 20:27             ` Linus Torvalds
2006-02-09 20:37               ` Linus Torvalds
2006-02-09 20:47                 ` Junio C Hamano
2006-02-09 20:52                   ` Junio C Hamano
2006-02-09 21:53                     ` Junio C Hamano
2006-02-09 22:00                       ` Junio C Hamano
2006-02-09 22:26                         ` Junio C Hamano [this message]
2006-02-11  9:17                           ` Marco Costalba
2006-02-11 19:32                             ` Junio C Hamano
2006-02-11 20:59                             ` Junio C Hamano
2006-02-09 20:38               ` Junio C Hamano
2006-02-09 20:50                 ` Linus Torvalds
2006-02-09 21:11                   ` Junio C Hamano
2006-02-10 11:00                     ` [PATCH] combine-diff: Record diff status a bit more faithfully Junio C Hamano
2006-02-09 23:49               ` [PATCH] combine-diff: move formatting logic to show_combined_diff() Junio C Hamano
2006-02-09  3:13 ` gitweb using "--cc"? Kay Sievers

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7v3bis88y9.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).