{"thread":{"id":"21089","subject":"git-diff/git-diff-files: Turn off copy-detection?","startedAt":"2009-09-29T12:50:14Z","lastAt":"2009-09-29T15:05:26Z","messageCount":5,"participants":["Marius Storm-Olsen","Johannes Sixt","Miklos Vajna"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"123987","messageId":"4AC20286.6020108@gmail.com","threadId":"21089","inReplyTo":null,"subject":"git-diff/git-diff-files: Turn off copy-detection?","fromName":"Marius Storm-Olsen","fromEmail":"mstormo@gmail.com","sentAt":"2009-09-29T12:50:14Z","receivedAt":"2009-09-29T12:50:14Z","isPatch":false,"sender":{"key":"mstormo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Hi,\n\nI'm trying to diff the header files between two version of a repo, to \ndo an ABI review, but get too many diffs from 'similar copy', which \nmakes the review hard. These are generally unrelated files, but due to \nlarge copyright header, and spaces, the actual changes are not large \nenough to be detected as new files. I'd therefore like to turn off \ncopy detection completely, or at least set some kind of threshold \nbefore a file is considered a copy in the diff.\n\nDoing a 'git diff origin/4.5..origin/4.6 -- src/corelib' gives me this \nexcerpt:\n\ndiff --git origin/4.5/src/corelib/tools/qtimeline.h \norigin/4.6/src/corelib/animation/qabstractanimation.h\nsimilarity index 58%\n...\ndiff --git origin/4.5/src/corelib/kernel/qsystemsemaphore.h \norigin/4.6/src/corelib/animation/qanimationgroup.h\nsimilarity index 63%\n...\ndiff --git origin/4.5/src/corelib/kernel/qsystemsemaphore.h \norigin/4.6/src/corelib/animation/qparallelanimationgroup.h\nsimilarity index 63%\n...\ndiff --git origin/4.5/src/corelib/io/qresource_iterator_p.h \norigin/4.6/src/corelib/animation/qpauseanimation.h\nsimilarity index 68%\n...\ndiff --git origin/4.5/src/corelib/kernel/qsystemsemaphore.h \norigin/4.6/src/corelib/animation/qpropertyanimation.h\nsimilarity index 60%\n...\ndiff --git origin/4.5/src/corelib/kernel/qsystemsemaphore.h \norigin/4.6/src/corelib/animation/qsequentialanimationgroup.h\nsimilarity index 55%\n...\ndiff --git origin/4.5/src/corelib/animation/qvariantanimation.h \norigin/4.6/src/corelib/animation/qvariantanimation.h\nnew file mode 100644\n...\ndiff --git origin/4.5/src/corelib/arch/qatomic_arch.h \norigin/4.6/src/corelib/arch/qatomic_arch.h\nindex 52ab101..548a5e9 100644\n\nSo, not even related. They should really had shown up as new files, \nIMO. (I guess git stores the creation of the file as a delta of the \nindicated 'copy', but in this case I don't care about that :)\n\nThanks!\n\n--\n.marius\n"},{"id":"123989","messageId":"4AC20E37.3090204@viscovery.net","threadId":"21089","inReplyTo":"4AC20286.6020108@gmail.com","subject":"Re: git-diff/git-diff-files: Turn off copy-detection?","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-09-29T13:40:07Z","receivedAt":"2009-09-29T13:40:07Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Marius Storm-Olsen schrieb:\n> I'm trying to diff the header files between two version of a repo, to do\n> an ABI review, but get too many diffs from 'similar copy', which makes\n> the review hard. These are generally unrelated files, but due to large\n> copyright header, and spaces, the actual changes are not large enough to\n> be detected as new files. I'd therefore like to turn off copy detection\n> completely, or at least set some kind of threshold before a file is\n> considered a copy in the diff.\n> \n> Doing a 'git diff origin/4.5..origin/4.6 -- src/corelib' gives me this\n> excerpt:\n> \n> diff --git origin/4.5/src/corelib/tools/qtimeline.h\n> origin/4.6/src/corelib/animation/qabstractanimation.h\n> similarity index 58%\n> ...\n\nYou must have the config variable diff.renames set. But I would not expect\nthat this setting applies to 'git diff-files', only to 'git diff'.\n\nYou can also try 'git diff -C99 -M99' if you don't want to unset the\nconfig variable.\n\n-- Hannes\n"},{"id":"123990","messageId":"20090929134241.GL32702@genesis.frugalware.org","threadId":"21089","inReplyTo":"4AC20286.6020108@gmail.com","subject":"Re: git-diff/git-diff-files: Turn off copy-detection?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-09-29T13:42:41Z","receivedAt":"2009-09-29T13:42:41Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Tue, Sep 29, 2009 at 02:50:14PM +0200, Marius Storm-Olsen <mstormo@gmail.com> wrote:\n> So, not even related. They should really had shown up as new files, \n> IMO. (I guess git stores the creation of the file as a delta of the \n> indicated 'copy', but in this case I don't care about that :)\n\nNo, it does not (as long as we are not talking about packfiles). AFAIK\ncopy detection is disabled by default, so probably you have a setting\nthat enables it for you and you forgot about it. Are you sure you don't\nhave any settings like diff.renames = copies?\n"},{"id":"123993","messageId":"4AC218BB.4080807@gmail.com","threadId":"21089","inReplyTo":"4AC20E37.3090204@viscovery.net","subject":"Re: git-diff/git-diff-files: Turn off copy-detection?","fromName":"Marius Storm-Olsen","fromEmail":"marius@storm-olsen.com","sentAt":"2009-09-29T14:24:59Z","receivedAt":"2009-09-29T14:24:59Z","isPatch":false,"sender":{"key":"marius@storm-olsen.com","avatar":"https://avatars.githubusercontent.com/u/1500?v=4"},"body":"Johannes Sixt said the following on 29.09.2009 15:40:\n> Marius Storm-Olsen schrieb:\n>> Doing a 'git diff origin/4.5..origin/4.6 -- src/corelib' gives me this\n>> excerpt:\n>>\n>> diff --git origin/4.5/src/corelib/tools/qtimeline.h\n>> origin/4.6/src/corelib/animation/qabstractanimation.h\n>> similarity index 58%\n>> ...\n> \n> You must have the config variable diff.renames set. But I would not expect\n> that this setting applies to 'git diff-files', only to 'git diff'.\n\n$ git config diff.renames\ncopies\n\nThat's it, thanks! Strange that nothing in the git-diff documentation \npointed me in this direction? Obviously I didn't connect the dots \nbetween 'copy' and 'renames' either..\n\n\n> You can also try 'git diff -C99 -M99' if you don't want to unset the\n> config variable.\n\nThanks, I'll add that to my review script. Much appreciated!\n\n--\n.marius\n"},{"id":"123997","messageId":"20090929150526.GM32702@genesis.frugalware.org","threadId":"21089","inReplyTo":"4AC218BB.4080807@gmail.com","subject":"Re: git-diff/git-diff-files: Turn off copy-detection?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-09-29T15:05:26Z","receivedAt":"2009-09-29T15:05:26Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Tue, Sep 29, 2009 at 04:24:59PM +0200, Marius Storm-Olsen <marius@storm-olsen.com> wrote:\n> $ git config diff.renames\n> copies\n> \n> That's it, thanks! Strange that nothing in the git-diff documentation \n> pointed me in this direction? Obviously I didn't connect the dots \n> between 'copy' and 'renames' either..\n\nSee man git-config. :)\n"}]}