{"thread":{"id":"14573","subject":"[PATCH] bring description of git diff --cc up to date","startedAt":"2008-07-21T18:27:23Z","lastAt":"2008-07-22T06:41:39Z","messageCount":2,"participants":["Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"84217","messageId":"Pine.GSO.4.62.0807211316530.2841@harper.uchicago.edu","threadId":"14573","inReplyTo":null,"subject":"[PATCH] bring description of git diff --cc up to date","fromName":"Jonathan Nieder","fromEmail":"jrnieder@uchicago.edu","sentAt":"2008-07-21T18:27:23Z","receivedAt":"2008-07-21T18:27:23Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"In February 2006 [1], the behavior of diff --cc was changed to\nfit a more appropriate notion of \"interesting hunks\" in Octopus\nmerges.  This patch updates documentation accordingly.\n\n[1] commit bf1c32bdec8223785c779779d0a660a099f69a63\n    combine-diff: update --cc \"uninteresting hunks\" logic\n\nSigned-off-by: Jonathan Nieder <jrnieder@uchicago.edu>\n---\n\tHello, all.  A while ago when someone was asking about the diff\n\t--cc output, I noticed some mistakes in the documentation but\n\tnever got around to fixing them.  So here's a small fix.  After\n\tthis patch, many issues remain:\n\n\t - The user would usually look to git-diff(1) or git-log(1) for\n\t   an explanation of the --cc option, not git-diff-tree(1) or\n\t   git-rev-list(1).\n\t - diff-format.txt contains the cryptic text \"Note that\n\t   'combined diff' lists only files which were modified from\n\t   all parents.\"  I have no idea what that means.\n\t - There is some duplication of text between git-diff-tree(1)\n\t   and git-rev-list(1) here.  I don't think that's such a big\n\t   deal, though.\n\t - My proposed text here is not very intuitive or clear, and it\n\t   does not suggest very strongly what --cc is intended to do\n\t   (to point out \"evil merges\" and other merges where the\n\t   integrator is likely to have made a mistake).  Alternate\n\t   wordings welcome!\n\n\tAt least this patch would not makes matters worse.\n\n Documentation/git-diff-tree.txt    |   12 +++++++-----\n Documentation/rev-list-options.txt |    9 +++++----\n 2 files changed, 12 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt\nindex 0e45b58..5a81d5d 100644\n--- a/Documentation/git-diff-tree.txt\n+++ b/Documentation/git-diff-tree.txt\n@@ -92,12 +92,14 @@ include::pretty-options.txt[]\n --cc::\n \tThis flag changes the way a merge commit patch is displayed,\n \tin a similar way to the '-c' option. It implies the '-c'\n-\tand '-p' options and further compresses the patch output\n-\tby omitting hunks that show differences from only one\n-\tparent, or show the same change from all but one parent\n-\tfor an Octopus merge.  When this optimization makes all\n+\tand '-p' options and makes the patch output\n+\teven more compact by omitting uninteresting hunks.  A hunk is\n+\tconsidered interesting only if either (a) it shows changes from\n+\tall parents or (b) in an Octopus merge, it shows different changes\n+\tfrom at least three different parents.\n+\tWhen this optimization makes all\n \thunks disappear, the commit itself and the commit log\n-\tmessage is not shown, just like in any other \"empty diff\" case.\n+\tmessage are not shown, just like in any other \"empty diff\" case.\n \n --always::\n \tShow the commit itself and the commit log message even\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex b6f5d87..a399e2b 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -111,10 +111,11 @@ options may be given. See linkgit:git-diff-files[1] for more options.\n \n --cc::\n \n-\tThis flag implies the '-c' options and further compresses the\n-\tpatch output by omitting hunks that show differences from only\n-\tone parent, or show the same change from all but one parent for\n-\tan Octopus merge.\n+\tThis flag implies the '-c' option and makes the patch output\n+\teven more compact by omitting uninteresting hunks.  A hunk is\n+\tconsidered interesting only if either (a) it shows changes from\n+\tall parents or (b) in an Octopus merge, it shows different changes\n+\tfrom at least three different parents.\n \n -r::\n \n-- \n1.5.6.3.549.g8ca11\n"},{"id":"84282","messageId":"7vfxq2pgik.fsf@gitster.siamese.dyndns.org","threadId":"14573","inReplyTo":"Pine.GSO.4.62.0807211316530.2841@harper.uchicago.edu","subject":"Re: [PATCH] bring description of git diff --cc up to date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-22T06:41:39Z","receivedAt":"2008-07-22T06:41:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@uchicago.edu> writes:\n\n> +\tThis flag implies the '-c' option and makes the patch output\n> +\teven more compact by omitting uninteresting hunks.  A hunk is\n> +\tconsidered interesting only if either (a) it shows changes from\n> +\tall parents or (b) in an Octopus merge, it shows different changes\n> +\tfrom at least three different parents.\n\nI am not sure where that \"at lesta three different parents\" comes from.\nIt might be that what the logic does can be expressed that way, but that\nwas not the guiding principle why the code does what it currently does.\n\nThese two might make it clearer what hunks are considered interesting:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/15098/focus=15109\n    http://thread.gmane.org/gmane.comp.version-control.git/15486/focus=15491\n\nEspecially the latter thread, not just the focused one but the whole\nthing, is quite amusing.\n\nThis one gives an insight into the logical consequence of the hunk\nselection criteria:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/15486/focus=15600\n\nit is worth a read after understanding why some hunks are omitted and some\nhunks are included by reading other articles in the thread.\n"}]}