Re: gitweb using "--cc"?

Subsystems: the rest

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: gitweb using "--cc"?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:18

Junio C Hamano [off-list ref] writes:
Junio C Hamano [off-list ref] writes:
quoted
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 [off-list ref]
    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);
 	}

Re: gitweb using "--cc"?

From: Marco Costalba <hidden>
Date: 2016-06-15 22:42:18

On 2/9/06, Junio C Hamano [off-list ref] wrote:
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.
Yes, please preserve this behaviour.

I pulled today the diff-tree -c semantic change and now I see, in git archive:

$ git-diff-tree -r ca182053c7710a286d72102f4576cf32e0dafcfb
ca182053c7710a286d72102f4576cf32e0dafcfb
::100644 100644 100644 538d21d808b7ccc287e7bdd947f1583eadcda28b
30479b4a19805132a16facf6342b1438427486b7
59042d1bc9ee65063455b50a0968efb0b8182577 MM        Makefile

$ git-diff-tree -r -m ca182053c7710a286d72102f4576cf32e0dafcfb
ca182053c7710a286d72102f4576cf32e0dafcfb
:100644 100644 538d21d808b7ccc287e7bdd947f1583eadcda28b
59042d1bc9ee65063455b50a0968efb0b8182577 M      Makefile
:100644 100644 410b758aab7efc6d777f0344500f97b1cbc52946
6c47c3a3e1acb8badaadad42dfe3d0bd7a06cac3 M      entry.c
ca182053c7710a286d72102f4576cf32e0dafcfb
:100644 100644 30479b4a19805132a16facf6342b1438427486b7
59042d1bc9ee65063455b50a0968efb0b8182577 M      Makefile

Please _do not_ change this behaviour to make -m a no-op as stated in
"diff-tree -c raw output" patch message
(ee63802422af14e43eccce3c6dc4150a27ceb1a3).

qgit has the possibility to switch from "see all merge files" to "see
interesting only", so
we really need that difference between 'git-diff-tree -r' and
'git-diff-tree -r -m'

Anyhow I am very happy with this change because it broke qgit ;-) but when fixed
it will have a lot of code removed and will be faster too.

Thanks
Marco

Re: gitweb using "--cc"?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:18

Marco Costalba [off-list ref] writes:
On 2/9/06, Junio C Hamano [off-list ref] wrote:
quoted
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.
Yes, please preserve this behaviour.
...
Please _do not_ change this behaviour to make -m a no-op as stated in
"diff-tree -c raw output" patch message
(ee63802422af14e43eccce3c6dc4150a27ceb1a3).
The one you pulled already contains another one to fix that
ee6380 change done by gittus.  What "diff-tree -r -m ca1820"
shows should be the same as traditional "diff-tree -r -m ca1820"
output.

What is different is "diff-tree ca1820".  It used to show
*nothing* only because it is a merge.  It now defaults to show
"diff-tree -c ca1820".

For the sake of backward compatibility we could change it to not
output anything, but I sort of feel that is backwards.  If a
Porcelain wants raw-diff for 1 (or more) parents, "diff-tree -r
-m" has been the way to do so before the ee6380 change, and that
output has not changed (well ee6380 might have changed it but
now it is fixed).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help