{"thread":{"id":"33744","subject":"3 way merge during git p4 rebase is attempting to reapply past commits","startedAt":"2013-05-07T23:12:30Z","lastAt":"2013-05-08T14:32:12Z","messageCount":3,"participants":["Christopher Yee Mon","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"216667","messageId":"CAG4Fb8f8vxbqwnCn1B9EfZu3sM-3-wQ2dqcR+BezPaf_XEy5Xw@mail.gmail.com","threadId":"33744","inReplyTo":null,"subject":"3 way merge during git p4 rebase is attempting to reapply past commits","fromName":"Christopher Yee Mon","fromEmail":"christopher.yeemon@gmail.com","sentAt":"2013-05-07T23:12:30Z","receivedAt":"2013-05-07T23:12:30Z","isPatch":false,"sender":{"key":"christopher.yeemon@gmail.com","avatar":null},"body":"Hello,\n\nI have a setup where I have a remote non-bare repo cloned from a\nperforce workspace. It is used as a remote repo that people clone into\ntheir own user repos, make commits to, then push back into the remote\nrepo. Then I periodically run the following commands in a script to\npush those changes back to perforce.\n\ngit checkout -f\ngit clean -f\ngit p4 rebase --import-labels\ngit p4 submit -M --export-labels\ngit checkout -f\ngit clean -f\n\nSometimes, always after commits from one user's machine specifically,\nI get the following error below when pushing back to perforce at the\nremote repo. It seems to happen randomly, or at least intermittently,\nsince I often can't discern any major error during git committing to\nthe remote repo that precipitates this error. It does happen pretty\nreliably when I get a file conflict that I resolve and fix during\ncommitting though.\n\nPerforming incremental import into refs/remotes/p4/master git branch\nDepot paths: //depot/sub/folder/\nNo changes to import!\nRebasing the current branch onto remotes/p4/master\nFirst, rewinding head to replay your work on top of it...\nApplying: A commit that has already been made previously\nApplying: A second commit that has already been made in a previous commit\nUsing index info to reconstruct a base tree...\n<stdin>:15: space before tab in indent.\n                            a line of text\n<stdin>:24: space before tab in indent.\n                another line of text\n<stdin>:25: space before tab in indent.\n                a third line of text\n<stdin>:33: trailing whitespace.\n        a forth line of text\n<stdin>:71: trailing whitespace.\n\nwarning: squelched 1 whitespace error\nwarning: 6 lines add whitespace errors.\nFalling back to patching base and 3-way merge...\nAuto-merging file from second\nCONFLICT (content): Merge conflict in\na/file/in/the/second/pre-existing/commit/file.php\nAuto-merging a/file/in/the/second/pre-existing/commit/file.php\nFailed to merge in the changes.\nPatch failed at 0002 A second commit that has already been made in a\nprevious commit\n\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo check out the original branch and stop rebasing run \"git rebase --abort\".\n\nTraceback (most recent call last):\n  File \"/usr/lib/git-core/git-p4\", line 3373, in <module>\n    main()\n  File \"/usr/lib/git-core/git-p4\", line 3367, in main\n    if not cmd.run(args):\n  File \"/usr/lib/git-core/git-p4\", line 3150, in run\n    return self.rebase()\n  File \"/usr/lib/git-core/git-p4\", line 3167, in rebase\n    system(\"git rebase %s\" % upstream)\n  File \"/usr/lib/git-core/git-p4\", line 183, in system\n    raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command 'git rebase remotes/p4/master'\nreturned non-zero exit status 1\n\nThe patch is usually one that is already in the remote git repo and in\nperforce. At that point I have to run git rebase --skip, to skip the\npatch, then rerun the commands in the script again. Sometimes it's\nmultiple patches that cause this problem and I have to run git rebase\n--skip repeatedly. When I check the working copy of the remote repo, I\ndon't see any changes, no conflict markers, just the file.\n\nThe real problem happens when I run git rebase --continue. Usually I\nend up with repeated submits in perforce when I do that, which is\nobviously a corruption of data.\n\nIt sounds a lot like this error, except I don't know how git p4 is\nbranching, so I don't know how to diagnose it.\n\nhttp://stackoverflow.com/questions/4033009/git-rebase-conflicts-keep-blocking-progress\n\nI also asked stack overflow and someone there said it's probably the\nperforce user being different from the git user info, so I had all the\ngit users switch to having the same info as the perforce user info and\nthat did NOT solve the problem.\n\nhttp://stackoverflow.com/questions/16106900/git-p4-rebase-attempts-to-reapply-past-commits\n\nI'm not sure what could possibly be causing this or how to fix it.\nDoes anyone have any ideas?\n\nThanks\nChristopher Yee Mon\n"},{"id":"216678","messageId":"5189E42E.8050107@diamand.org","threadId":"33744","inReplyTo":"CAG4Fb8f8vxbqwnCn1B9EfZu3sM-3-wQ2dqcR+BezPaf_XEy5Xw@mail.gmail.com","subject":"Re: 3 way merge during git p4 rebase is attempting to reapply past commits","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2013-05-08T05:35:42Z","receivedAt":"2013-05-08T05:35:42Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 08/05/13 00:12, Christopher Yee Mon wrote:\n> Hello,\n>\n> I have a setup where I have a remote non-bare repo cloned from a\n> perforce workspace. It is used as a remote repo that people clone into\n> their own user repos, make commits to, then push back into the remote\n> repo.\nWhy is your p4 clone non-bare? I thought pushing into a non-bare repo \ntended to cause problems?\n\n > Then I periodically run the following commands in a script to\n > push those changes back to perforce.\n\n% man cron\n\n:-)\n\n\n>\n> git checkout -f\n> git clean -f\n> git p4 rebase --import-labels\n> git p4 submit -M --export-labels\n> git checkout -f\n> git clean -f\n>\n> Sometimes, always after commits from one user's machine specifically,\n> I get the following error below when pushing back to perforce at the\n> remote repo. It seems to happen randomly, or at least intermittently,\n> since I often can't discern any major error during git committing to\n> the remote repo that precipitates this error. It does happen pretty\n> reliably when I get a file conflict that I resolve and fix during\n> committing though.\n>\n> Performing incremental import into refs/remotes/p4/master git branch\n> Depot paths: //depot/sub/folder/\n> No changes to import!\n> Rebasing the current branch onto remotes/p4/master\n> First, rewinding head to replay your work on top of it...\n> Applying: A commit that has already been made previously\n> Applying: A second commit that has already been made in a previous commit\n> Using index info to reconstruct a base tree...\n> <stdin>:15: space before tab in indent.\n>                              a line of text\n> <stdin>:24: space before tab in indent.\n>                  another line of text\n> <stdin>:25: space before tab in indent.\n>                  a third line of text\n> <stdin>:33: trailing whitespace.\n>          a forth line of text\n> <stdin>:71: trailing whitespace.\n>\n> warning: squelched 1 whitespace error\n> warning: 6 lines add whitespace errors.\n> Falling back to patching base and 3-way merge...\n> Auto-merging file from second\n> CONFLICT (content): Merge conflict in\n> a/file/in/the/second/pre-existing/commit/file.php\n> Auto-merging a/file/in/the/second/pre-existing/commit/file.php\n> Failed to merge in the changes.\n> Patch failed at 0002 A second commit that has already been made in a\n> previous commit\n>\n> When you have resolved this problem run \"git rebase --continue\".\n> If you would prefer to skip this patch, instead run \"git rebase --skip\".\n> To check out the original branch and stop rebasing run \"git rebase --abort\".\n>\n> Traceback (most recent call last):\n>    File \"/usr/lib/git-core/git-p4\", line 3373, in<module>\n>      main()\n>    File \"/usr/lib/git-core/git-p4\", line 3367, in main\n>      if not cmd.run(args):\n>    File \"/usr/lib/git-core/git-p4\", line 3150, in run\n>      return self.rebase()\n>    File \"/usr/lib/git-core/git-p4\", line 3167, in rebase\n>      system(\"git rebase %s\" % upstream)\n>    File \"/usr/lib/git-core/git-p4\", line 183, in system\n>      raise CalledProcessError(retcode, cmd)\n> subprocess.CalledProcessError: Command 'git rebase remotes/p4/master'\n> returned non-zero exit status 1\n>\n> The patch is usually one that is already in the remote git repo and in\n> perforce. At that point I have to run git rebase --skip, to skip the\n> patch, then rerun the commands in the script again. Sometimes it's\n> multiple patches that cause this problem and I have to run git rebase\n> --skip repeatedly. When I check the working copy of the remote repo, I\n> don't see any changes, no conflict markers, just the file.\n>\n> The real problem happens when I run git rebase --continue. Usually I\n> end up with repeated submits in perforce when I do that, which is\n> obviously a corruption of data.\n>\n> It sounds a lot like this error, except I don't know how git p4 is\n> branching, so I don't know how to diagnose it.\n>\n> http://stackoverflow.com/questions/4033009/git-rebase-conflicts-keep-blocking-progress\n>\n> I also asked stack overflow and someone there said it's probably the\n> perforce user being different from the git user info, so I had all the\n> git users switch to having the same info as the perforce user info and\n> that did NOT solve the problem.\n>\n> http://stackoverflow.com/questions/16106900/git-p4-rebase-attempts-to-reapply-past-commits\n>\n> I'm not sure what could possibly be causing this or how to fix it.\n> Does anyone have any ideas?\n>\n> Thanks\n> Christopher Yee Mon\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"216709","messageId":"CAG4Fb8fJynC8kVaudKiCRYh=1MqH-k+2A3LCCEzf=psPrx+zuw@mail.gmail.com","threadId":"33744","inReplyTo":"5189E42E.8050107@diamand.org","subject":"Re: 3 way merge during git p4 rebase is attempting to reapply past commits","fromName":"Christopher Yee Mon","fromEmail":"christopher.yeemon@gmail.com","sentAt":"2013-05-08T14:32:12Z","receivedAt":"2013-05-08T14:32:12Z","isPatch":false,"sender":{"key":"christopher.yeemon@gmail.com","avatar":null},"body":"git p4 rebase and git p4 submit don't work on a bare repo (at least it\ndidn't for me) This is weird since there is a --bare option for git p4\nclone, but then you can't do git p4 submit's on that bare repo back up\nto perforce?\n\nI got an error stating:\n\ngit p4 rebase\nPerforming incremental import into refs/remotes/p4/master git branch\nDepot paths: //depot/path.to/folder/\nNo changes to import!\nfatal: This operation must be run in a work tree\nSome files in your working directory are modified and different than\nwhat is in your index. You can use git update-index <filename> to\nbring the index up-to-date or stash away all your changes with git\nstash.\n\nAnd I got this error for git p4 submit stating\n\nPerforce checkout for depot path //depot/path.to/folder/ located at\n/home/user1/path/to/perforce.folder/\nSynchronizing p4 checkout...\n... - file(s) up-to-date.\nfatal: Not a git repository: '.'\nCommand failed: ['git', 'rev-list', '--no-merges', 'remotes/p4/master..master']\n\nhttp://stackoverflow.com/questions/15512357/how-to-run-git-p4-submit-on-a-bare-repo\n(The workaround described seemed particularly convoluted.)\n\nMy only (simple) workaround for that is doing the git checkout -f and\ngit clean -f before and after doing git p4 rebase and git p4 submit (\nhttp://stackoverflow.com/questions/15512700/replace-working-copy-of-git-repo-with-actual-contents-of-repo-in-git\n)\n\nI've encountered so many errors over time that I can't trust to leave\nthe operation scheduled, because some problem like this might crop up\nagain.\n\nOn Wed, May 8, 2013 at 1:35 AM, Luke Diamand <luke@diamand.org> wrote:\n> On 08/05/13 00:12, Christopher Yee Mon wrote:\n>>\n>> Hello,\n>>\n>> I have a setup where I have a remote non-bare repo cloned from a\n>> perforce workspace. It is used as a remote repo that people clone into\n>> their own user repos, make commits to, then push back into the remote\n>> repo.\n>\n> Why is your p4 clone non-bare? I thought pushing into a non-bare repo tended\n> to cause problems?\n>\n>\n>> Then I periodically run the following commands in a script to\n>> push those changes back to perforce.\n>\n> % man cron\n>\n> :-)\n>\n>\n>>\n>> git checkout -f\n>> git clean -f\n>> git p4 rebase --import-labels\n>> git p4 submit -M --export-labels\n>> git checkout -f\n>> git clean -f\n>>\n>> Sometimes, always after commits from one user's machine specifically,\n>> I get the following error below when pushing back to perforce at the\n>> remote repo. It seems to happen randomly, or at least intermittently,\n>> since I often can't discern any major error during git committing to\n>> the remote repo that precipitates this error. It does happen pretty\n>> reliably when I get a file conflict that I resolve and fix during\n>> committing though.\n>>\n>> Performing incremental import into refs/remotes/p4/master git branch\n>> Depot paths: //depot/sub/folder/\n>> No changes to import!\n>> Rebasing the current branch onto remotes/p4/master\n>> First, rewinding head to replay your work on top of it...\n>> Applying: A commit that has already been made previously\n>> Applying: A second commit that has already been made in a previous commit\n>> Using index info to reconstruct a base tree...\n>> <stdin>:15: space before tab in indent.\n>>                              a line of text\n>> <stdin>:24: space before tab in indent.\n>>                  another line of text\n>> <stdin>:25: space before tab in indent.\n>>                  a third line of text\n>> <stdin>:33: trailing whitespace.\n>>          a forth line of text\n>> <stdin>:71: trailing whitespace.\n>>\n>> warning: squelched 1 whitespace error\n>> warning: 6 lines add whitespace errors.\n>> Falling back to patching base and 3-way merge...\n>> Auto-merging file from second\n>> CONFLICT (content): Merge conflict in\n>> a/file/in/the/second/pre-existing/commit/file.php\n>> Auto-merging a/file/in/the/second/pre-existing/commit/file.php\n>> Failed to merge in the changes.\n>> Patch failed at 0002 A second commit that has already been made in a\n>> previous commit\n>>\n>> When you have resolved this problem run \"git rebase --continue\".\n>> If you would prefer to skip this patch, instead run \"git rebase --skip\".\n>> To check out the original branch and stop rebasing run \"git rebase\n>> --abort\".\n>>\n>> Traceback (most recent call last):\n>>    File \"/usr/lib/git-core/git-p4\", line 3373, in<module>\n>>      main()\n>>    File \"/usr/lib/git-core/git-p4\", line 3367, in main\n>>      if not cmd.run(args):\n>>    File \"/usr/lib/git-core/git-p4\", line 3150, in run\n>>      return self.rebase()\n>>    File \"/usr/lib/git-core/git-p4\", line 3167, in rebase\n>>      system(\"git rebase %s\" % upstream)\n>>    File \"/usr/lib/git-core/git-p4\", line 183, in system\n>>      raise CalledProcessError(retcode, cmd)\n>> subprocess.CalledProcessError: Command 'git rebase remotes/p4/master'\n>> returned non-zero exit status 1\n>>\n>> The patch is usually one that is already in the remote git repo and in\n>> perforce. At that point I have to run git rebase --skip, to skip the\n>> patch, then rerun the commands in the script again. Sometimes it's\n>> multiple patches that cause this problem and I have to run git rebase\n>> --skip repeatedly. When I check the working copy of the remote repo, I\n>> don't see any changes, no conflict markers, just the file.\n>>\n>> The real problem happens when I run git rebase --continue. Usually I\n>> end up with repeated submits in perforce when I do that, which is\n>> obviously a corruption of data.\n>>\n>> It sounds a lot like this error, except I don't know how git p4 is\n>> branching, so I don't know how to diagnose it.\n>>\n>>\n>> http://stackoverflow.com/questions/4033009/git-rebase-conflicts-keep-blocking-progress\n>>\n>> I also asked stack overflow and someone there said it's probably the\n>> perforce user being different from the git user info, so I had all the\n>> git users switch to having the same info as the perforce user info and\n>> that did NOT solve the problem.\n>>\n>>\n>> http://stackoverflow.com/questions/16106900/git-p4-rebase-attempts-to-reapply-past-commits\n>>\n>> I'm not sure what could possibly be causing this or how to fix it.\n>> Does anyone have any ideas?\n>>\n>> Thanks\n>> Christopher Yee Mon\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n>\n"}]}