{"thread":{"id":"38466","subject":"Score in diff-format","startedAt":"2015-01-28T06:23:09Z","lastAt":"2015-01-29T06:20:51Z","messageCount":6,"participants":["Mike Hommey","Junio C Hamano","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"255360","messageId":"20150128062309.GA29506@glandium.org","threadId":"38466","inReplyTo":null,"subject":"Score in diff-format","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2015-01-28T06:23:09Z","receivedAt":"2015-01-28T06:23:09Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Hi,\n\ndiff-format.txt says this:\n\n  An output line is formatted this way:\n  (snip)\n\n  That is, from the left to the right:\n\n  (snip)\n  . status, followed by optional \"score\" number.\n\n  (snip)\n  Status letters C and R are always followed by a score (denoting the\n  percentage of similarity between the source and target of the move or\n  copy), and are the only ones to be so.\n\nAs I read this last paragraph, the following is not supposed to happen:\n$ git diff-tree 926b1ec63ee045503f609e88ca445b94c06bd5d7 --abbrev -r -C -B\n926b1ec63ee045503f609e88ca445b94c06bd5d7\n:100644 100644 81ac702... 7ab0cf4... M087       contrib/subtree/INSTALL\n\nIt however makes sense that it happens, and it looks like a case of the\ndocumentation being outdated or confusing. Or am I interpreting it wrong?\n\nCheers,\n\nMike\n"},{"id":"255366","messageId":"54C8F306.1000001@drmicha.warpmail.net","threadId":"38466","inReplyTo":"20150128062309.GA29506@glandium.org","subject":"Re: Score in diff-format","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2015-01-28T14:32:38Z","receivedAt":"2015-01-28T14:32:38Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Mike Hommey schrieb am 28.01.2015 um 07:23:\n> Hi,\n> \n> diff-format.txt says this:\n> \n>   An output line is formatted this way:\n>   (snip)\n> \n>   That is, from the left to the right:\n> \n>   (snip)\n>   . status, followed by optional \"score\" number.\n> \n>   (snip)\n>   Status letters C and R are always followed by a score (denoting the\n>   percentage of similarity between the source and target of the move or\n>   copy), and are the only ones to be so.\n>\n> As I read this last paragraph, the following is not supposed to happen:\n> $ git diff-tree 926b1ec63ee045503f609e88ca445b94c06bd5d7 --abbrev -r -C -B\n> 926b1ec63ee045503f609e88ca445b94c06bd5d7\n> :100644 100644 81ac702... 7ab0cf4... M087       contrib/subtree/INSTALL\n> \n> It however makes sense that it happens, and it looks like a case of the\n> documentation being outdated or confusing. Or am I interpreting it wrong?\n\nI'd say it depends on the definition of \"so\". The documentation is\ncorrect if you read \"so\" as \"*always* followed by a score\". I guess you\nread it as \"followed by a score\".\n\nPercentages with M are not mentioned in diff-format, but they are a\nconsequence of \"-B\" processing. Maybe we could mention that?\n\nMichael\n"},{"id":"255362","messageId":"xmqqegqeivho.fsf@gitster.dls.corp.google.com","threadId":"38466","inReplyTo":"20150128062309.GA29506@glandium.org","subject":"Re: Score in diff-format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-28T18:57:23Z","receivedAt":"2015-01-28T18:57:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n>   (snip)\n>   Status letters C and R are always followed by a score (denoting the\n>   percentage of similarity between the source and target of the move or\n>   copy), and are the only ones to be so.\n\nGood eyes.  I _think_ what happened was that break-and-then-merge\n(aka complete rewrite detection) came way after this was originally\nwritten, and \"the only ones to be so\" is stale in the world with\ncomplete rewrite feature enabled.\n\nPerhaps update\n\n    , and are the only ones to be so.\n\nto\n\n    ; M may be followed by a score to denote how complete a rewrite\n    the change is.\n\nor something like that?\n"},{"id":"255384","messageId":"xmqqk306fvvk.fsf@gitster.dls.corp.google.com","threadId":"38466","inReplyTo":"54C8F306.1000001@drmicha.warpmail.net","subject":"Re: Score in diff-format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-28T21:17:19Z","receivedAt":"2015-01-28T21:17:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> I'd say it depends on the definition of \"so\". The documentation is\n> correct if you read \"so\" as \"*always* followed by a score\". I guess you\n> read it as \"followed by a score\".\n\nI read it so as well ;-)\n\n> Percentages with M are not mentioned in diff-format, but they are a\n> consequence of \"-B\" processing. Maybe we could mention that?\n\n-- >8 --\nSubject: diff-format doc: a score can follow M for rewrite\n\nb6d8f309 (diff-raw format update take #2., 2005-05-23) started\ndocumenting the diff format, and it said\n\n ...\n (8) sha1 for \"dst\"; 0{40} if creation, unmerged or \"look at work tree\".\n (9) status, followed by similarlity index number only for C and R.\n (10) a tab or a NUL when '-z' option is used.\n ...\n\nbecause C and R _were_ the only ones that came with a number back\nthen.  This was corrected by ddafa7e9 (diff-helper: Fix R/C score\nparsing under -z flag., 2005-05-29) and we started saying \"score\"\ninstead of \"similarlity index\" (because we can have other kind of\nscore there), and stopped saying \"only for C and R\" (because Git is\nan ever evolving system).  Later f345b0a0 ([PATCH] Add -B flag to\ndiff-* brothers., 2005-05-30) introduced a new concept,\n\"dissimilarity\" score and it did not have to fix any documentation.\n\nThe current text that says only C and R can have scores came\nindependently from a5a323f3 (Add reference for status letters in\ndocumentation., 2008-11-02) and it was wrong from the day one.\n\nNoticed-by: Mike Hommey\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n Documentation/diff-format.txt | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\nindex 15c7e79..e6cfc9b 100644\n--- a/Documentation/diff-format.txt\n+++ b/Documentation/diff-format.txt\n@@ -66,7 +66,8 @@ be committed)\n \n Status letters C and R are always followed by a score (denoting the\n percentage of similarity between the source and target of the move or\n-copy), and are the only ones to be so.\n+copy).  M may show how completely the modification rewrites the file\n+with a score (denoting the percentage of dissimilarity).\n \n <sha1> is shown as all 0's if a file is new on the filesystem\n and it is out of sync with the index.\n"},{"id":"255385","messageId":"20150129012211.GA11678@glandium.org","threadId":"38466","inReplyTo":"xmqqk306fvvk.fsf@gitster.dls.corp.google.com","subject":"Re: Score in diff-format","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2015-01-29T01:22:11Z","receivedAt":"2015-01-29T01:22:11Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Wed, Jan 28, 2015 at 01:17:19PM -0800, Junio C Hamano wrote:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n> > I'd say it depends on the definition of \"so\". The documentation is\n> > correct if you read \"so\" as \"*always* followed by a score\". I guess you\n> > read it as \"followed by a score\".\n> \n> I read it so as well ;-)\n> \n> > Percentages with M are not mentioned in diff-format, but they are a\n> > consequence of \"-B\" processing. Maybe we could mention that?\n> \n> -- >8 --\n> Subject: diff-format doc: a score can follow M for rewrite\n> \n> b6d8f309 (diff-raw format update take #2., 2005-05-23) started\n> documenting the diff format, and it said\n> \n>  ...\n>  (8) sha1 for \"dst\"; 0{40} if creation, unmerged or \"look at work tree\".\n>  (9) status, followed by similarlity index number only for C and R.\n>  (10) a tab or a NUL when '-z' option is used.\n>  ...\n> \n> because C and R _were_ the only ones that came with a number back\n> then.  This was corrected by ddafa7e9 (diff-helper: Fix R/C score\n> parsing under -z flag., 2005-05-29) and we started saying \"score\"\n> instead of \"similarlity index\" (because we can have other kind of\n> score there), and stopped saying \"only for C and R\" (because Git is\n> an ever evolving system).  Later f345b0a0 ([PATCH] Add -B flag to\n> diff-* brothers., 2005-05-30) introduced a new concept,\n> \"dissimilarity\" score and it did not have to fix any documentation.\n> \n> The current text that says only C and R can have scores came\n> independently from a5a323f3 (Add reference for status letters in\n> documentation., 2008-11-02) and it was wrong from the day one.\n> \n> Noticed-by: Mike Hommey\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n>  Documentation/diff-format.txt | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n> index 15c7e79..e6cfc9b 100644\n> --- a/Documentation/diff-format.txt\n> +++ b/Documentation/diff-format.txt\n> @@ -66,7 +66,8 @@ be committed)\n>  \n>  Status letters C and R are always followed by a score (denoting the\n>  percentage of similarity between the source and target of the move or\n> -copy), and are the only ones to be so.\n> +copy).  M may show how completely the modification rewrites the file\n> +with a score (denoting the percentage of dissimilarity).\n\nHow about something like:\n\n  Status letter M may be followed by a score (denoting the percentage of\n  dissimilarity) for file rewrites.\n\nMike\n"},{"id":"255398","messageId":"xmqq386uf6po.fsf@gitster.dls.corp.google.com","threadId":"38466","inReplyTo":"20150129012211.GA11678@glandium.org","subject":"Re: Score in diff-format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-01-29T06:20:51Z","receivedAt":"2015-01-29T06:20:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> On Wed, Jan 28, 2015 at 01:17:19PM -0800, Junio C Hamano wrote:\n>> diff --git a/Documentation/diff-format.txt b/Documentation/diff-format.txt\n>> index 15c7e79..e6cfc9b 100644\n>> --- a/Documentation/diff-format.txt\n>> +++ b/Documentation/diff-format.txt\n>> @@ -66,7 +66,8 @@ be committed)\n>>  \n>>  Status letters C and R are always followed by a score (denoting the\n>>  percentage of similarity between the source and target of the move or\n>> -copy), and are the only ones to be so.\n>> +copy).  M may show how completely the modification rewrites the file\n>> +with a score (denoting the percentage of dissimilarity).\n>\n> How about something like:\n>\n>   Status letter M may be followed by a score (denoting the percentage of\n>   dissimilarity) for file rewrites.\n\nOK.  That seems to make the end result sound more consistent by\nrepeated use of \"status letter X\".  Let's use that.\n\nThanks.\n"}]}