{"thread":{"id":"32381","subject":"bug? 'git log -M100' is different from 'git log -M100%'","startedAt":"2012-12-17T23:34:46Z","lastAt":"2012-12-18T04:17:33Z","messageCount":3,"participants":["Sitaram Chamarty","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205095","messageId":"20121217233446.GA5987@sita-lt.atc.tcs.com","threadId":"32381","inReplyTo":null,"subject":"bug? 'git log -M100' is different from 'git log -M100%'","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-12-17T23:34:46Z","receivedAt":"2012-12-17T23:34:46Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Hi,\n\nWhen using -M with a number to act as a threshold for declaring\na change as being a rename, I found a... quirk.  Any 2-digit\nnumber after the M will work, but if the number is 100, it will\nrequire a % to be appended to be effective.\n\nHere's a transcript that will demonstrate the problem when run\nin an empty directory.\n\n    # setup\n    git init\n    seq 1 100 > f1\n    git add f1\n    git commit -m f1\n    git rm f1\n    ( seq 1 45; seq 1001 1010; seq 56 100 ) > f2\n    git add f2\n    git commit -m f2\n\n    # here's the buglet\n\n    git log -1 --stat --raw -M\n    # this tells you the files are 83% similar\n\n    git log -1 --stat --raw -M82\n    # this shows it like a rename\n\n    git log -1 --stat --raw -M83\n    # this also\n\n    git log -1 --stat --raw -M84\n    # this shows two separate files\n\n    git log -1 --stat --raw -M99\n    # this also\n\n    # so far so good...\n\n    git log -1 --stat --raw -M100\n    # but this shows it like a rename\n\n    git log -1 --stat --raw -M100%\n    # adding a percent sign fixes it, now they're two separate\n    # files.  It seems to be required only when you ask for 100%\n\n-- \nSitaram Chamarty\n"},{"id":"205097","messageId":"7vfw34jgmv.fsf@alter.siamese.dyndns.org","threadId":"32381","inReplyTo":"20121217233446.GA5987@sita-lt.atc.tcs.com","subject":"Re: bug? 'git log -M100' is different from 'git log -M100%'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-18T01:25:28Z","receivedAt":"2012-12-18T01:25:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> When using -M with a number to act as a threshold for declaring\n> a change as being a rename, I found a... quirk.  Any 2-digit\n> number after the M will work,...\n\nThat is not 2-digit number.\n\nA few historical trivia may help.\n\nOriginally we said \"you can use -M2 to choose 2/10\" (like \"gzip\"\ntaking compression levels between \"-0\" to \"-9\").  Then Linus came up\nwith a clever idea to let people specify arbitrary precision by\nletting you say \"-M25\" to mean 25/100 and \"-M254\" to mean 254/1000.\n\nRead the numbers without per-cent as if it has decimal point before\nit (i.e. -M005 is talking about 0.005 which is 0.5%).  Full hundred\nper-cent has to be spelled with per-cent sign for obvious reasons\nwith this scheme but that cannot be avoided.  It is a special case.\n"},{"id":"205107","messageId":"CAMK1S_jVuJgmdb47A=SGV7_9uH2SEj-SHYFdSY_7nSuLCNxdkQ@mail.gmail.com","threadId":"32381","inReplyTo":"7vfw34jgmv.fsf@alter.siamese.dyndns.org","subject":"Re: bug? 'git log -M100' is different from 'git log -M100%'","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-12-18T04:17:33Z","receivedAt":"2012-12-18T04:17:33Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Tue, Dec 18, 2012 at 6:55 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n>\n>> When using -M with a number to act as a threshold for declaring\n>> a change as being a rename, I found a... quirk.  Any 2-digit\n>> number after the M will work,...\n>\n> That is not 2-digit number.\n>\n> A few historical trivia may help.\n>\n> Originally we said \"you can use -M2 to choose 2/10\" (like \"gzip\"\n> taking compression levels between \"-0\" to \"-9\").  Then Linus came up\n> with a clever idea to let people specify arbitrary precision by\n> letting you say \"-M25\" to mean 25/100 and \"-M254\" to mean 254/1000.\n>\n> Read the numbers without per-cent as if it has decimal point before\n> it (i.e. -M005 is talking about 0.005 which is 0.5%).  Full hundred\n> per-cent has to be spelled with per-cent sign for obvious reasons\n> with this scheme but that cannot be avoided.  It is a special case.\n\nOh nice.  Makes sense; thanks!\n\nI submitted a patch to diff-options.txt (separately).\n\nregards\n\nsitaram\n"}]}