{"thread":{"id":"61032","subject":"Accuracy of \"git blame -C\" - are there configuration options?","startedAt":"2024-03-01T07:21:28Z","lastAt":"2024-03-08T13:59:27Z","messageCount":2,"participants":["Baumann, Moritz"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"489730","messageId":"AS1PR02MB81858FD5DDD15551754AEA74945E2@AS1PR02MB8185.eurprd02.prod.outlook.com","threadId":"61032","inReplyTo":null,"subject":"Accuracy of \"git blame -C\" - are there configuration options?","fromName":"Baumann, Moritz","fromEmail":"moritz.baumann@sap.com","sentAt":"2024-03-01T07:21:23Z","receivedAt":"2024-03-01T07:21:28Z","isPatch":false,"sender":{"key":"moritz.baumann@sap.com","avatar":"https://avatars.githubusercontent.com/u/67415316?v=4"},"body":"Hi,\n\nA colleague recently experimented with \"git blame -C\" and noticed that\nthe accuracy with which git detects lines moved from other files varies\na lot depending on the sizes of the files involved.\n\nExample repository: https://github.com/Boddlnagg/git-blame-problem\n\nThe latest commit on all branches moves some lines from Decl.cpp to\nline 93 of DeclBase.cpp. \"git blame -C\" doesn't detect this on main, but\non the \"works-as-expected\" branch, in which the size of Decl.cpp was\nartificially reduced, it does.\n\nFurther experiments show that the following work as well:\ngit blame -L 93,95 -C main -- DeclBase.cpp\ngit blame -L 80,108 -C main -- DeclBase.cpp\n\nHowever, with a sufficiently large range, it stops working again:\ngit blame -L 80,109 -C main -- DeclBase.cpp\n\nHow does the pickaxe search of git blame work under the hood? Are there\nany configuration options I can use if I want to trade performance for\naccuracy?\n\nBest regards,\nMoritz Baumann"},{"id":"490242","messageId":"AS1PR02MB81855C978C6A42E4D6E2DE5C94272@AS1PR02MB8185.eurprd02.prod.outlook.com","threadId":"61032","inReplyTo":"AS1PR02MB81858FD5DDD15551754AEA74945E2@AS1PR02MB8185.eurprd02.prod.outlook.com","subject":"Re: Accuracy of \"git blame -C\" - are there configuration options?","fromName":"Baumann, Moritz","fromEmail":"moritz.baumann@sap.com","sentAt":"2024-03-08T13:59:24Z","receivedAt":"2024-03-08T13:59:27Z","isPatch":false,"sender":{"key":"moritz.baumann@sap.com","avatar":"https://avatars.githubusercontent.com/u/67415316?v=4"},"body":"Maybe I should rephrase the question to clarify what I want to achieve:\n\nIs there a way to execute 'git blame -C' for an entire large file at \nonce and get the same accurate results as if 'git blame -C -L' had been\ncalled for each line separately?\n\n---\n \nHi,\n\nA colleague recently experimented with \"git blame -C\" and noticed that\nthe accuracy with which git detects lines moved from other files varies\na lot depending on the sizes of the files involved.\n\nExample repository: https://github.com/Boddlnagg/git-blame-problem\n\nThe latest commit on all branches moves some lines from Decl.cpp to\nline 93 of DeclBase.cpp. \"git blame -C\" doesn't detect this on main, but\non the \"works-as-expected\" branch, in which the size of Decl.cpp was\nartificially reduced, it does.\n\nFurther experiments show that the following work as well:\ngit blame -L 93,95 -C main -- DeclBase.cpp\ngit blame -L 80,108 -C main -- DeclBase.cpp\n\nHowever, with a sufficiently large range, it stops working again:\ngit blame -L 80,109 -C main -- DeclBase.cpp\n\nHow does the pickaxe search of git blame work under the hood? Are there\nany configuration options I can use if I want to trade performance for\naccuracy?\n\nBest regards,\nMoritz Baumann"}]}