{"thread":{"id":"26367","subject":"[PATCH 1/2] git-p4: Improve rename detection support.","startedAt":"2011-01-30T23:19:22Z","lastAt":"2011-02-12T13:32:23Z","messageCount":10,"participants":["Vitor Antunes","Pete Wyckoff"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"160073","messageId":"1296429563-18390-1-git-send-email-vitor.hda@gmail.com","threadId":"26367","inReplyTo":null,"subject":"[PATCH 1/2] git-p4: Improve rename detection support.","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-01-30T23:19:22Z","receivedAt":"2011-01-30T23:19:22Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Only open files for edit after integrating if the SHA1 of source and destination\ndiffer from each other.\nAdd git config option detectRenames to allow permanent rename detection. This\noptions should be set to a true/false value.\n\nSigned-off-by: Vitor Antunes <vitor.hda@gmail.com>\n---\n contrib/fast-import/git-p4 |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 04ce7e3..9fb480a 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -613,7 +613,13 @@ class P4Submit(Command):\n \n     def applyCommit(self, id):\n         print \"Applying %s\" % (read_pipe(\"git log --max-count=1 --pretty=oneline %s\" % id))\n-        diffOpts = (\"\", \"-M\")[self.detectRename]\n+\n+        detectRenames = gitConfig(\"git-p4.detectRenames\")\n+        if len(detectRenames) and detectRenames.lower() != \"false\" > 0:\n+            diffOpts = \"-M\"\n+        else:\n+            diffOpts = (\"\", \"-M\")[self.detectRename]\n+\n         diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (diffOpts, id, id))\n         filesToAdd = set()\n         filesToDelete = set()\n@@ -640,7 +646,8 @@ class P4Submit(Command):\n             elif modifier == \"R\":\n                 src, dest = diff['src'], diff['dst']\n                 p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n-                p4_system(\"edit \\\"%s\\\"\" % (dest))\n+                if diff['src_sha1'] != diff['dst_sha1']:\n+                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n                 if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n                     filesToChangeExecBit[dest] = diff['dst_mode']\n                 os.unlink(dest)\n-- \n1.7.2.3\n"},{"id":"160074","messageId":"1296429563-18390-2-git-send-email-vitor.hda@gmail.com","threadId":"26367","inReplyTo":"1296429563-18390-1-git-send-email-vitor.hda@gmail.com","subject":"[PATCH 2/2] git-p4: Add copy detection support","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-01-30T23:19:23Z","receivedAt":"2011-01-30T23:19:23Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Add new config options:\n    git-p4.detectCopies         - Enable copy detection.\n    git-p4.detectCopiesHarder   - Find copies harder.\nThe detectCopies option should be set to a true/false value.\nThe detectCopiesHarder option should be set to true/false value.\nP4Submit can now process diff-tree C status and integrate files accordingly.\n---\n contrib/fast-import/git-p4 |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 9fb480a..9b67ae2 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -620,6 +620,14 @@ class P4Submit(Command):\n         else:\n             diffOpts = (\"\", \"-M\")[self.detectRename]\n \n+        detectCopies = gitConfig(\"git-p4.detectCopies\")\n+        if len(detectCopies) and detectCopies.lower() != \"false\" > 0:\n+            diffOpts += \" -C\"\n+\n+        detectCopiesHarder = gitConfig(\"git-p4.detectCopiesHarder\")\n+        if len(detectCopiesHarder) > 0 and detectCopiesHarder.lower() != \"false\":\n+            diffOpts += \" --find-copies-harder\"\n+\n         diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (diffOpts, id, id))\n         filesToAdd = set()\n         filesToDelete = set()\n@@ -643,6 +651,15 @@ class P4Submit(Command):\n                 filesToDelete.add(path)\n                 if path in filesToAdd:\n                     filesToAdd.remove(path)\n+            elif modifier == \"C\":\n+                src, dest = diff['src'], diff['dst']\n+                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n+                if diff['src_sha1'] != diff['dst_sha1']:\n+                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n+                if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n+                    filesToChangeExecBit[dest] = diff['dst_mode']\n+                os.unlink(dest)\n+                editedFiles.add(dest)\n             elif modifier == \"R\":\n                 src, dest = diff['src'], diff['dst']\n                 p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n-- \n1.7.2.3\n"},{"id":"160481","messageId":"20110206002113.GA31245@arf.padd.com","threadId":"26367","inReplyTo":"1296429563-18390-1-git-send-email-vitor.hda@gmail.com","subject":"Re: [PATCH 1/2] git-p4: Improve rename detection support.","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-02-06T00:21:13Z","receivedAt":"2011-02-06T00:21:13Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Sun, 30 Jan 2011 23:19 +0000:\n> Only open files for edit after integrating if the SHA1 of source and destination\n> differ from each other.\n> Add git config option detectRenames to allow permanent rename detection. This\n> options should be set to a true/false value.\n\nI like the idea.\n\n>      def applyCommit(self, id):\n>          print \"Applying %s\" % (read_pipe(\"git log --max-count=1 --pretty=oneline %s\" % id))\n> -        diffOpts = (\"\", \"-M\")[self.detectRename]\n> +\n> +        detectRenames = gitConfig(\"git-p4.detectRenames\")\n> +        if len(detectRenames) and detectRenames.lower() != \"false\" > 0:\n> +            diffOpts = \"-M\"\n> +        else:\n> +            diffOpts = (\"\", \"-M\")[self.detectRename]\n\nThe comparisons confuse me.  detectRenames != \"false\" > 0  ?\nHow about just detectRenames == \"true\"?\n\nYou could rename the existing self.detectRename to add an \"s\" so\nit all makes a bit more sense.\n\n    if not self.detectRenames:\n\t# not explicitly set, check the config variable\n\tb = gitConfig(\"git-p4.detectRenames\")\n\tif b == \"true\":\n\t    self.detectRenames = \"-M\"\n\n    if self.detectRenames:\n\tdiffOpts = \"-M\"\n    else:\n\tdiffOpts = \"\"\n\n>          diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (diffOpts, id, id))\n>          filesToAdd = set()\n>          filesToDelete = set()\n> @@ -640,7 +646,8 @@ class P4Submit(Command):\n>              elif modifier == \"R\":\n>                  src, dest = diff['src'], diff['dst']\n>                  p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n> -                p4_system(\"edit \\\"%s\\\"\" % (dest))\n> +                if diff['src_sha1'] != diff['dst_sha1']:\n> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n>                  if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n>                      filesToChangeExecBit[dest] = diff['dst_mode']\n>                  os.unlink(dest)\n\nIf you rename the file and also cause its perms to change (say\nadd +x), does it still work if dest is not open?\n\n\t\t-- Pete\n"},{"id":"160482","messageId":"20110206002547.GB31245@arf.padd.com","threadId":"26367","inReplyTo":"1296429563-18390-2-git-send-email-vitor.hda@gmail.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-02-06T00:25:47Z","receivedAt":"2011-02-06T00:25:47Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Sun, 30 Jan 2011 23:19 +0000:\n> Add new config options:\n>     git-p4.detectCopies         - Enable copy detection.\n>     git-p4.detectCopiesHarder   - Find copies harder.\n> The detectCopies option should be set to a true/false value.\n> The detectCopiesHarder option should be set to true/false value.\n> P4Submit can now process diff-tree C status and integrate files accordingly.\n> ---\n[..]\n> +        detectCopies = gitConfig(\"git-p4.detectCopies\")\n> +        if len(detectCopies) and detectCopies.lower() != \"false\" > 0:\n> +            diffOpts += \" -C\"\n> +\n> +        detectCopiesHarder = gitConfig(\"git-p4.detectCopiesHarder\")\n> +        if len(detectCopiesHarder) > 0 and detectCopiesHarder.lower() != \"false\":\n> +            diffOpts += \" --find-copies-harder\"\n> +\n\nI like it, but same weirdness with != > 0.\n\n> +            elif modifier == \"C\":\n> +                src, dest = diff['src'], diff['dst']\n> +                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n> +                if diff['src_sha1'] != diff['dst_sha1']:\n> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n> +                if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n> +                    filesToChangeExecBit[dest] = diff['dst_mode']\n> +                os.unlink(dest)\n> +                editedFiles.add(dest)\n\nYou can use integrate -t to force the filetype even if the file\nalready existed, and skip the whole execbit change.\n\n\t\t-- Pete\n"},{"id":"160505","messageId":"AANLkTikd+rGpfy9x35SA0g4F8uYpjp_+GK4m9pagu8Nn@mail.gmail.com","threadId":"26367","inReplyTo":"20110206002113.GA31245@arf.padd.com","subject":"Re: [PATCH 1/2] git-p4: Improve rename detection support.","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-02-06T12:39:25Z","receivedAt":"2011-02-06T12:39:25Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Pete,\n\nOn Sun, Feb 6, 2011 at 12:21 AM, Pete Wyckoff <pw@padd.com> wrote:\n> The comparisons confuse me.  detectRenames != \"false\" > 0  ?\n> How about just detectRenames == \"true\"?\n\nThe \"> 0\" was for the length check. I somehow (*feeling embarrassed*)\nmisplaced that code...\n\n> You could rename the existing self.detectRename to add an \"s\" so\n> it all makes a bit more sense.\n>\n>    if not self.detectRenames:\n>        # not explicitly set, check the config variable\n>        b = gitConfig(\"git-p4.detectRenames\")\n>        if b == \"true\":\n>            self.detectRenames = \"-M\"\n>\n>    if self.detectRenames:\n>        diffOpts = \"-M\"\n>    else:\n>        diffOpts = \"\"\n\nSeems like a better idea. I kind of like the original code to set\ndiffOpts, so I would prefer to keep it. What do you think of (didn't\ntest it):\n\n        if not self.detectRenames:\n            # If not explicitly set check the config variable\n            self.detectRenames =\ngitConfig(\"git-p4.detectRenames\").lower() == \"true\"\n\n        diffOpts = (\"\", \"-M\")[self.detectRenames]\n\n>>          diff = read_pipe_lines(\"git diff-tree -r %s \\\"%s^\\\" \\\"%s\\\"\" % (diffOpts, id, id))\n>>          filesToAdd = set()\n>>          filesToDelete = set()\n>> @@ -640,7 +646,8 @@ class P4Submit(Command):\n>>              elif modifier == \"R\":\n>>                  src, dest = diff['src'], diff['dst']\n>>                  p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n>> -                p4_system(\"edit \\\"%s\\\"\" % (dest))\n>> +                if diff['src_sha1'] != diff['dst_sha1']:\n>> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n>>                  if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n>>                      filesToChangeExecBit[dest] = diff['dst_mode']\n>>                  os.unlink(dest)\n>\n> If you rename the file and also cause its perms to change (say\n> add +x), does it still work if dest is not open?\n\nThis is a very good point. I will also open the file for edit when\nthere is a mode change.\n\nThanks!\n\n-- \nVitor Antunes\n"},{"id":"160503","messageId":"AANLkTi=Awi6d77QcbbZ2rDTv6LpP+qjsReJ5=4NyhUBz@mail.gmail.com","threadId":"26367","inReplyTo":"20110206002547.GB31245@arf.padd.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-02-06T17:25:54Z","receivedAt":"2011-02-06T17:25:54Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Pete,\n\nOn Sun, Feb 6, 2011 at 12:25 AM, Pete Wyckoff <pw@padd.com> wrote:\n> You can use integrate -t to force the filetype even if the file\n> already existed, and skip the whole execbit change.\n\n(Copying help text:\n\tThe -t flag makes the source file's filetype propagate to the target\n\tfile.  Normally, the target file retains its previous filetype.\n\tNewly branched files always use the source file's filetype.  The\n\tfiletype can still be changed before 'p4 submit' with 'p4 reopen'.\n)\n\nSince in git we're only considering newly branched files, I think in\nthis case \"-t\" will not add anything. In fact, what is being done here\nis detecting exec bit changes from source to target files - we're not\ntrying to force P4 to use the source's exec bit. Do you agree?\n\nKind regards,\n-- \nVitor Antunes\n"},{"id":"160553","messageId":"20110206220546.GA9024@mew.padd.com","threadId":"26367","inReplyTo":"AANLkTi=Awi6d77QcbbZ2rDTv6LpP+qjsReJ5=4NyhUBz@mail.gmail.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-02-06T22:05:46Z","receivedAt":"2011-02-06T22:05:46Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Sun, 06 Feb 2011 17:25 +0000:\n> Hi Pete,\n> \n> On Sun, Feb 6, 2011 at 12:25 AM, Pete Wyckoff <pw@padd.com> wrote:\n> > You can use integrate -t to force the filetype even if the file\n> > already existed, and skip the whole execbit change.\n> \n> (Copying help text:\n> \tThe -t flag makes the source file's filetype propagate to the target\n> \tfile.  Normally, the target file retains its previous filetype.\n> \tNewly branched files always use the source file's filetype.  The\n> \tfiletype can still be changed before 'p4 submit' with 'p4 reopen'.\n> )\n> \n> Since in git we're only considering newly branched files, I think in\n> this case \"-t\" will not add anything. In fact, what is being done here\n> is detecting exec bit changes from source to target files - we're not\n> trying to force P4 to use the source's exec bit. Do you agree?\n\nThat sounds fine to me.  The code seemed to indicate that\nsometimes the destination file exists.\n\n> +            elif modifier == \"C\":\n> +                src, dest = diff['src'], diff['dst']\n> +                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n> +                if diff['src_sha1'] != diff['dst_sha1']:\n> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n> +                if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n> +                    filesToChangeExecBit[dest] = diff['dst_mode']\n> +                os.unlink(dest)\n> +                editedFiles.add(dest)\n\nIf you're happy the dest never exists, you may be able to get rid\nof the edit step and the mode-change check entirely.  As long as\nyou've tested this, you're the expert here.  The change makes\nsense overall.\n\n\t\t-- Pete\n"},{"id":"160598","messageId":"AANLkTikO4=froHvYN-JCOMZF7zgGHaD4J=nbN1ij_RjW@mail.gmail.com","threadId":"26367","inReplyTo":"20110206220546.GA9024@mew.padd.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-02-07T11:11:24Z","receivedAt":"2011-02-07T11:11:24Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Pete,\n\nOn Sun, Feb 6, 2011 at 10:05 PM, Pete Wyckoff <pw@padd.com> wrote:\n>> (Copying help text:\n>>       The -t flag makes the source file's filetype propagate to the target\n>>       file.  Normally, the target file retains its previous filetype.\n>>       Newly branched files always use the source file's filetype.  The\n>>       filetype can still be changed before 'p4 submit' with 'p4 reopen'.\n>> )\n>>\n>> Since in git we're only considering newly branched files, I think in\n>> this case \"-t\" will not add anything. In fact, what is being done here\n>> is detecting exec bit changes from source to target files - we're not\n>> trying to force P4 to use the source's exec bit. Do you agree?\n>\n> That sounds fine to me.  The code seemed to indicate that\n> sometimes the destination file exists.\n\nI've basically copied the code from the rename detection part and\nadapted it to copying. Nevertheless, even if git detects a copy to a\nalready existing file I think that the integrate command should behave\ncorrectly. I should create a test case for this, though.\n\n>> +            elif modifier == \"C\":\n>> +                src, dest = diff['src'], diff['dst']\n>> +                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n>> +                if diff['src_sha1'] != diff['dst_sha1']:\n>> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n>> +                if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n>> +                    filesToChangeExecBit[dest] = diff['dst_mode']\n>> +                os.unlink(dest)\n>> +                editedFiles.add(dest)\n>\n> If you're happy the dest never exists, you may be able to get rid\n> of the edit step and the mode-change check entirely.  As long as\n> you've tested this, you're the expert here.  The change makes\n> sense overall.\n\nI'm not that happy with this... and I'm no expert! I will really need\nto test this possibility. Just need to understand how I can make git\ndetect a copy to an existing file... :)\n\nThanks for your feedback,\n-- \nVitor Antunes\n"},{"id":"160918","messageId":"AANLkTinF=9ELNMV0TmBzjEPa=7BZF+dnAK7VUrUw4QNK@mail.gmail.com","threadId":"26367","inReplyTo":"AANLkTikO4=froHvYN-JCOMZF7zgGHaD4J=nbN1ij_RjW@mail.gmail.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Vitor Antunes","fromEmail":"vitor.hda@gmail.com","sentAt":"2011-02-12T00:29:34Z","receivedAt":"2011-02-12T00:29:34Z","isPatch":true,"sender":{"key":"vitor.hda@gmail.com","avatar":"https://avatars.githubusercontent.com/u/606876?v=4"},"body":"Hi Pete,\n\nOn Mon, Feb 7, 2011 at 11:11 AM, Vitor Antunes <vitor.hda@gmail.com> wrote:\n> Hi Pete,\n>\n> On Sun, Feb 6, 2011 at 10:05 PM, Pete Wyckoff <pw@padd.com> wrote:\n>>> (Copying help text:\n>>>       The -t flag makes the source file's filetype propagate to the target\n>>>       file.  Normally, the target file retains its previous filetype.\n>>>       Newly branched files always use the source file's filetype.  The\n>>>       filetype can still be changed before 'p4 submit' with 'p4 reopen'.\n>>> )\n>>>\n>>> Since in git we're only considering newly branched files, I think in\n>>> this case \"-t\" will not add anything. In fact, what is being done here\n>>> is detecting exec bit changes from source to target files - we're not\n>>> trying to force P4 to use the source's exec bit. Do you agree?\n>>\n>> That sounds fine to me.  The code seemed to indicate that\n>> sometimes the destination file exists.\n>\n> I've basically copied the code from the rename detection part and\n> adapted it to copying. Nevertheless, even if git detects a copy to a\n> already existing file I think that the integrate command should behave\n> correctly. I should create a test case for this, though.\n>\n>>> +            elif modifier == \"C\":\n>>> +                src, dest = diff['src'], diff['dst']\n>>> +                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n>>> +                if diff['src_sha1'] != diff['dst_sha1']:\n>>> +                    p4_system(\"edit \\\"%s\\\"\" % (dest))\n>>> +                if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n>>> +                    filesToChangeExecBit[dest] = diff['dst_mode']\n>>> +                os.unlink(dest)\n>>> +                editedFiles.add(dest)\n>>\n>> If you're happy the dest never exists, you may be able to get rid\n>> of the edit step and the mode-change check entirely.  As long as\n>> you've tested this, you're the expert here.  The change makes\n>> sense overall.\n>\n> I'm not that happy with this... and I'm no expert! I will really need\n> to test this possibility. Just need to understand how I can make git\n> detect a copy to an existing file... :)\n\nI've tried to trick git into detecting a copy over an existing file by\nreplacing a file with the contents of another file. But git is not\ndetecting this as a copy. How can I make git detect a copy over an\nexisting file?\n\nAfter re-reading your answer I got the feeling that this SHA diff code\nmay have been misinterpreted. So, just in case it was, here is the\nfull history.\nOriginally the code always opened the files for editing just in case\nthere was a patch to be applied late,r. This makes sense, because git\ncan detect a rename (or copy) even if the files differ. But doing this\nwould create an \"unclean\" integration in the revision graph. So, what\nI thought was \"if we have available the SHA of the origin and\ndestination files in diff-tree output why not compare them before\nopening the file for editing?\" And that was the only purpose for this\ncomparison.\n\n-- \nVitor Antunes\n"},{"id":"160950","messageId":"20110212133223.GA12432@arf.padd.com","threadId":"26367","inReplyTo":"AANLkTinF=9ELNMV0TmBzjEPa=7BZF+dnAK7VUrUw4QNK@mail.gmail.com","subject":"Re: [PATCH 2/2] git-p4: Add copy detection support","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2011-02-12T13:32:23Z","receivedAt":"2011-02-12T13:32:23Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"vitor.hda@gmail.com wrote on Sat, 12 Feb 2011 00:29 +0000:\n> Originally the code always opened the files for editing just in case\n> there was a patch to be applied late,r. This makes sense, because git\n> can detect a rename (or copy) even if the files differ. But doing this\n> would create an \"unclean\" integration in the revision graph. So, what\n> I thought was \"if we have available the SHA of the origin and\n> destination files in diff-tree output why not compare them before\n> opening the file for editing?\" And that was the only purpose for this\n> comparison.\n\nI get what you are saying and it makes sense to fix this.  I\nthink you are on the right track, and I can't see the problem\nin the code.\n\nSide note:  p4 installations can make client SubmitOptions\nhave \"revertunchanged\" to avoid these annoying null integrations.\n\n\t\t-- Pete\n"}]}