{"thread":{"id":"16160","subject":"Re: Intensive rename detection","startedAt":"2008-11-04T01:18:20Z","lastAt":"2008-11-05T03:22:21Z","messageCount":11,"participants":["Andrew Arnott","Junio C Hamano","Linus Torvalds","Jeff King","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"94835","messageId":"216e54900811031718o4cc81294sc0c32be1e71b9372@mail.gmail.com","threadId":"16160","inReplyTo":"216e54900811031717j70669868p3c7503357ceb5138@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Andrew Arnott","fromEmail":"andrewarnott@gmail.com","sentAt":"2008-11-04T01:18:20Z","receivedAt":"2008-11-04T01:18:20Z","isPatch":false,"sender":{"key":"andrewarnott@gmail.com","avatar":"https://gravatar.com/avatar/e5c2778a1fae32d11e605bca8a9f56f78c43f0b042a5a907471bc4f01cfea4a5?d=mp&s=160"},"body":"I'm refactoring a library including renaming both files and\ndirectories.  A few lines of each file are also changed, but they are\nsubstantially unchanged in content.  I've done a git add to put all my\nchanges into the index, but a git status shows that git only detected\na few of the renames... most of them are delete-add operations.  Is\nthere anything I can do to help git recognize the rename so that\nhistory is preserved across this commit?\n\nThanks.\n"},{"id":"94838","messageId":"7vy700s215.fsf@gitster.siamese.dyndns.org","threadId":"16160","inReplyTo":"216e54900811031718o4cc81294sc0c32be1e71b9372@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-04T01:39:02Z","receivedAt":"2008-11-04T01:39:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Andrew Arnott\" <andrewarnott@gmail.com> writes:\n\n> I'm refactoring a library including renaming both files and\n> directories.  A few lines of each file are also changed, but they are\n> substantially unchanged in content.  I've done a git add to put all my\n> changes into the index, but a git status shows that git only detected\n> a few of the renames... most of them are delete-add operations.  Is\n> there anything I can do to help git recognize the rename so that\n> history is preserved across this commit?\n\nThere is no need to do anything at commit time.\n\nAfter making the commit, you can look at it with lower similarity\nthreashold, e.g.\n\n\tgit show --stat -M1 HEAD\n\nThe default behaviour IIRC corresponds to -M5 (that is 50%).\n"},{"id":"94845","messageId":"alpine.LFD.2.00.0811032021210.3419@nehalem.linux-foundation.org","threadId":"16160","inReplyTo":"216e54900811031718o4cc81294sc0c32be1e71b9372@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-11-04T04:22:34Z","receivedAt":"2008-11-04T04:22:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 3 Nov 2008, Andrew Arnott wrote:\n>\n> I'm refactoring a library including renaming both files and\n> directories.  A few lines of each file are also changed, but they are\n> substantially unchanged in content.  I've done a git add to put all my\n> changes into the index, but a git status shows that git only detected\n> a few of the renames... most of them are delete-add operations.  Is\n> there anything I can do to help git recognize the rename so that\n> history is preserved across this commit?\n\nHow many renames do you have? Modern versions of git will do any number of \nexact renames, but the (rather expensive) inexact rename detection has a \ndefault limit of something fairly small.\n\nYou could try adding\n\n\t[diff]\n\t\trenamelimit=0\n\nto your ~/.gitconfig file. It can be quite expensive though.\n\n\t\t\tLinus\n"},{"id":"94846","messageId":"alpine.LFD.2.00.0811032022580.3419@nehalem.linux-foundation.org","threadId":"16160","inReplyTo":"alpine.LFD.2.00.0811032021210.3419@nehalem.linux-foundation.org","subject":"Re: Intensive rename detection","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-11-04T04:23:54Z","receivedAt":"2008-11-04T04:23:54Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 3 Nov 2008, Linus Torvalds wrote:\n> \n> You could try adding\n> \n> \t[diff]\n> \t\trenamelimit=0\n> \n> to your ~/.gitconfig file. It can be quite expensive though.\n\nOh, and obviously Junio is right that some create/deletes won't be seen as \nrenames anyway, if you changed enough of the file and/or if the files in \nquestion are so small that they end up being considered rewrites just \nbecause of that.\n\n\t\tLinus\n"},{"id":"94848","messageId":"20081104043133.GB31276@coredump.intra.peff.net","threadId":"16160","inReplyTo":"alpine.LFD.2.00.0811032021210.3419@nehalem.linux-foundation.org","subject":"Re: Intensive rename detection","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-04T04:31:33Z","receivedAt":"2008-11-04T04:31:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 03, 2008 at 08:22:34PM -0800, Linus Torvalds wrote:\n\n> How many renames do you have? Modern versions of git will do any number of \n> exact renames, but the (rather expensive) inexact rename detection has a \n> default limit of something fairly small.\n\nI was about to say \"git should have complained about turning off the\nrequested rename detection\", but I forgot that we silenced that warning\nexcept for merges.\n\nMaybe it makes sense for \"status\" or a single \"diff\" (but definitely not\n\"log\", where it isn't even clear which diff caused it!). I dunno. I find\nit clutter for anything except a merge, but if that is in fact what is\nhappening here, it might have produced one slightly less confused user.\n\n-Peff\n"},{"id":"94853","messageId":"216e54900811032119h4cb51327v2d85712acc444185@mail.gmail.com","threadId":"16160","inReplyTo":"216e54900811032107p159e98ecn8958f0a78efde8f2@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Andrew Arnott","fromEmail":"andrewarnott@gmail.com","sentAt":"2008-11-04T05:19:30Z","receivedAt":"2008-11-04T05:19:30Z","isPatch":false,"sender":{"key":"andrewarnott@gmail.com","avatar":"https://gravatar.com/avatar/e5c2778a1fae32d11e605bca8a9f56f78c43f0b042a5a907471bc4f01cfea4a5?d=mp&s=160"},"body":"Awesome.  Per Linus' tip, I just noticed at the top of a long list of\nmessages git said:\nwarning: too many files, skipping inexact rename detection\n\nSo I added the config file change, and that did the trick.  Thanks, everyone!\n\nHere's a related but slightly different question: I've been stashing\nand unstashing in the midst of all these renames and refactoring, and\nnow I'm left with some files listed in git status 3 times.  I\nunderstand why this is, but I don't know the best way to proceed.  Git\nis telling me:\n\n$ git status | grep MessageBase\nsrc/DotNetOAuth/Messages/MessageBase.cs: needs merge\nsrc/DotNetOAuth/OAuth/Messages/MessageBase.cs: needs merge\nsrc/DotNetOpenAuth/Messages/MessageBase.cs: needs merge\n#       unmerged:   src/DotNetOAuth/Messages/MessageBase.cs\n#       unmerged:   src/DotNetOAuth/OAuth/Messages/MessageBase.cs\n#       unmerged:   src/DotNetOpenAuth/Messages/MessageBase.cs\n\nI want to end up with MessageBase.cs in\nsrc/DotNetOpenAuth/OAuth/Messages/MessageBase.cs, which ironically is\nnone of these three.  And the couple of lines that changed in the file\nneed to be merged.  Only two of these listed files exist on disk.  How\ncan I best leverage git to merge the two files on disk while moving it\nto a new location?\n\n> On Mon, Nov 3, 2008 at 8:22 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>>\n>>\n>> On Mon, 3 Nov 2008, Andrew Arnott wrote:\n>> >\n>> > I'm refactoring a library including renaming both files and\n>> > directories.  A few lines of each file are also changed, but they are\n>> > substantially unchanged in content.  I've done a git add to put all my\n>> > changes into the index, but a git status shows that git only detected\n>> > a few of the renames... most of them are delete-add operations.  Is\n>> > there anything I can do to help git recognize the rename so that\n>> > history is preserved across this commit?\n>>\n>> How many renames do you have? Modern versions of git will do any number of\n>> exact renames, but the (rather expensive) inexact rename detection has a\n>> default limit of something fairly small.\n>>\n>> You could try adding\n>>\n>>        [diff]\n>>                renamelimit=0\n>>\n>> to your ~/.gitconfig file. It can be quite expensive though.\n>>\n>>                        Linus\n>\n"},{"id":"94857","messageId":"216e54900811032202h5c82e3a9j30100e5b82f6a16a@mail.gmail.com","threadId":"16160","inReplyTo":"216e54900811032119h4cb51327v2d85712acc444185@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Andrew Arnott","fromEmail":"andrewarnott@gmail.com","sentAt":"2008-11-04T06:02:37Z","receivedAt":"2008-11-04T06:02:37Z","isPatch":false,"sender":{"key":"andrewarnott@gmail.com","avatar":"https://gravatar.com/avatar/e5c2778a1fae32d11e605bca8a9f56f78c43f0b042a5a907471bc4f01cfea4a5?d=mp&s=160"},"body":"Hmmm.... actually on second run I am still getting the too many files\nwarning.  I put the [diff] section in a ~/.gitconfig file, a\n.gitconfig file in the root of my repo, and in the .git/config file,\nbut none of them seem to get rid of the message.\n\nI'm running git version 1.5.5.1015.g9d258\n\nIs that too old for this removal of a file rename limit?\n\nOn Mon, Nov 3, 2008 at 9:19 PM, Andrew Arnott <andrewarnott@gmail.com> wrote:\n> Awesome.  Per Linus' tip, I just noticed at the top of a long list of\n> messages git said:\n> warning: too many files, skipping inexact rename detection\n>\n> So I added the config file change, and that did the trick.  Thanks, everyone!\n>\n> Here's a related but slightly different question: I've been stashing\n> and unstashing in the midst of all these renames and refactoring, and\n> now I'm left with some files listed in git status 3 times.  I\n> understand why this is, but I don't know the best way to proceed.  Git\n> is telling me:\n>\n> $ git status | grep MessageBase\n> src/DotNetOAuth/Messages/MessageBase.cs: needs merge\n> src/DotNetOAuth/OAuth/Messages/MessageBase.cs: needs merge\n> src/DotNetOpenAuth/Messages/MessageBase.cs: needs merge\n> #       unmerged:   src/DotNetOAuth/Messages/MessageBase.cs\n> #       unmerged:   src/DotNetOAuth/OAuth/Messages/MessageBase.cs\n> #       unmerged:   src/DotNetOpenAuth/Messages/MessageBase.cs\n>\n> I want to end up with MessageBase.cs in\n> src/DotNetOpenAuth/OAuth/Messages/MessageBase.cs, which ironically is\n> none of these three.  And the couple of lines that changed in the file\n> need to be merged.  Only two of these listed files exist on disk.  How\n> can I best leverage git to merge the two files on disk while moving it\n> to a new location?\n>\n>> On Mon, Nov 3, 2008 at 8:22 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>>>\n>>>\n>>> On Mon, 3 Nov 2008, Andrew Arnott wrote:\n>>> >\n>>> > I'm refactoring a library including renaming both files and\n>>> > directories.  A few lines of each file are also changed, but they are\n>>> > substantially unchanged in content.  I've done a git add to put all my\n>>> > changes into the index, but a git status shows that git only detected\n>>> > a few of the renames... most of them are delete-add operations.  Is\n>>> > there anything I can do to help git recognize the rename so that\n>>> > history is preserved across this commit?\n>>>\n>>> How many renames do you have? Modern versions of git will do any number of\n>>> exact renames, but the (rather expensive) inexact rename detection has a\n>>> default limit of something fairly small.\n>>>\n>>> You could try adding\n>>>\n>>>        [diff]\n>>>                renamelimit=0\n>>>\n>>> to your ~/.gitconfig file. It can be quite expensive though.\n>>>\n>>>                        Linus\n>>\n>\n"},{"id":"94858","messageId":"20081104061647.GA18297@coredump.intra.peff.net","threadId":"16160","inReplyTo":"216e54900811032202h5c82e3a9j30100e5b82f6a16a@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-04T06:16:47Z","receivedAt":"2008-11-04T06:16:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 03, 2008 at 10:02:37PM -0800, Andrew Arnott wrote:\n\n> Hmmm.... actually on second run I am still getting the too many files\n> warning.  I put the [diff] section in a ~/.gitconfig file, a\n> .gitconfig file in the root of my repo, and in the .git/config file,\n> but none of them seem to get rid of the message.\n\nWhere are you getting the warning? On \"git status\"?\n\nIf so, then this is an instance of the problem I mentioned here:\n\n  [PATCH v3 7/8] wt-status: load diff ui config\n  20081026044935.GG21047@coredump.intra.peff.net\n\n(sorry, I would link to gmane, but it seems to be down at the moment).\nJunio, maybe it is worth applying after all (we could also do just the\ndiff \"basic\" config instead).\n\n-Peff\n"},{"id":"94860","messageId":"216e54900811032236l5ae4bde5v16ab6519962e428f@mail.gmail.com","threadId":"16160","inReplyTo":"20081104061647.GA18297@coredump.intra.peff.net","subject":"Re: Intensive rename detection","fromName":"Andrew Arnott","fromEmail":"andrewarnott@gmail.com","sentAt":"2008-11-04T06:36:42Z","receivedAt":"2008-11-04T06:36:42Z","isPatch":false,"sender":{"key":"andrewarnott@gmail.com","avatar":"https://gravatar.com/avatar/e5c2778a1fae32d11e605bca8a9f56f78c43f0b042a5a907471bc4f01cfea4a5?d=mp&s=160"},"body":"Yes, on git status.  I'm afraid I don't know how to look up the\nreference you gave.\n\nOn Mon, Nov 3, 2008 at 10:16 PM, Jeff King <peff@peff.net> wrote:\n> On Mon, Nov 03, 2008 at 10:02:37PM -0800, Andrew Arnott wrote:\n>\n>> Hmmm.... actually on second run I am still getting the too many files\n>> warning.  I put the [diff] section in a ~/.gitconfig file, a\n>> .gitconfig file in the root of my repo, and in the .git/config file,\n>> but none of them seem to get rid of the message.\n>\n> Where are you getting the warning? On \"git status\"?\n>\n> If so, then this is an instance of the problem I mentioned here:\n>\n>  [PATCH v3 7/8] wt-status: load diff ui config\n>  20081026044935.GG21047@coredump.intra.peff.net\n>\n> (sorry, I would link to gmane, but it seems to be down at the moment).\n> Junio, maybe it is worth applying after all (we could also do just the\n> diff \"basic\" config instead).\n>\n> -Peff\n>\n"},{"id":"94882","messageId":"20081104104738.GD21251@atjola.homenet","threadId":"16160","inReplyTo":"216e54900811032236l5ae4bde5v16ab6519962e428f@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-11-04T10:47:38Z","receivedAt":"2008-11-04T10:47:38Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.11.03 22:36:42 -0800, Andrew Arnott wrote:\n> On Mon, Nov 3, 2008 at 10:16 PM, Jeff King <peff@peff.net> wrote:\n> > On Mon, Nov 03, 2008 at 10:02:37PM -0800, Andrew Arnott wrote:\n> >\n> >> Hmmm.... actually on second run I am still getting the too many files\n> >> warning.  I put the [diff] section in a ~/.gitconfig file, a\n> >> .gitconfig file in the root of my repo, and in the .git/config file,\n> >> but none of them seem to get rid of the message.\n> >\n> > Where are you getting the warning? On \"git status\"?\n> >\n> > If so, then this is an instance of the problem I mentioned here:\n> >\n> >  [PATCH v3 7/8] wt-status: load diff ui config\n> >  20081026044935.GG21047@coredump.intra.peff.net\n>\n> Yes, on git status.  I'm afraid I don't know how to look up the\n> reference you gave.\n\nhttp://marc.info/?l=git&m=122499658810367&w=2\n\nBjörn\n"},{"id":"94953","messageId":"20081105032220.GE20907@coredump.intra.peff.net","threadId":"16160","inReplyTo":"216e54900811032236l5ae4bde5v16ab6519962e428f@mail.gmail.com","subject":"Re: Intensive rename detection","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-05T03:22:21Z","receivedAt":"2008-11-05T03:22:21Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 03, 2008 at 10:36:42PM -0800, Andrew Arnott wrote:\n\n> Yes, on git status.  I'm afraid I don't know how to look up the\n> reference you gave.\n\nSorry, gmane is back up, so the link is:\n\n  http://article.gmane.org/gmane.comp.version-control.git/99147\n\nWith that patch, and this one on top, \"git status\" should respect your\nrename limits (though I haven't tested it).\n\n---\ndiff --git a/wt-status.c b/wt-status.c\nindex c3a9cab..0b92ac3 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -214,7 +214,6 @@ static void wt_status_print_updated(struct wt_status *s)\n \trev.diffopt.format_callback = wt_status_print_updated_cb;\n \trev.diffopt.format_callback_data = s;\n \trev.diffopt.detect_rename = 1;\n-\trev.diffopt.rename_limit = 200;\n \trev.diffopt.break_opt = 0;\n \trun_diff_index(&rev, 1);\n }\n\n-Peff\n"}]}