{"thread":{"id":"12413","subject":"git-rebase dirty index and email address bug?","startedAt":"2008-03-01T20:40:24Z","lastAt":"2008-03-04T15:22:39Z","messageCount":8,"participants":["John Goerzen","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"70555","messageId":"slrnfsjfpo.3fl.jgoerzen@katherina.lan.complete.org","threadId":"12413","inReplyTo":null,"subject":"git-rebase dirty index and email address bug?","fromName":"John Goerzen","fromEmail":"jgoerzen@complete.org","sentAt":"2008-03-01T20:40:24Z","receivedAt":"2008-03-01T20:40:24Z","isPatch":false,"sender":{"key":"jgoerzen@complete.org","avatar":null},"body":"Hi folks,\n\nI have checked out a remote git repo.  I have hacked on my local copy\nfor the last two days.  I have performed no merges or anything elese\nodd.  Today I git fetched the remote, and then I tried to git rebase\nupstream/master.  I had committed all outstanding changes first.  My\nindex was clean.  It displayed:\n\nFirst, rewinding head to replay your work on top of it...\nHEAD is now at 77f1a60... Merge branch 'trunk'\nDirty index: cannot apply patches (dirty: public/dispatch.fcgi)\n\nTthat particular file was one that I added.  It did not exist upstream\neither at my initial checkout, nor was it added upstream at any point\nsince.\n\ngit status shows:\n\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       new file:   public/dispatch.fcgi\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       .dotest/\n\nSo I tried the git reset command on public/dispatch.fcgi, and also\nthen deleted that file.  I then tried git-rebase --continue, which\ndisplayed:\n\nsed: can't read .dotest/info: No such file or directory\nsed: can't read .dotest/info: No such file or directory\nsed: can't read .dotest/info: No such file or directory\nPatch does not have a valid e-mail address.\n\nI have no idea what sed is complaining about, but that last line is\ninteresting.  The upstream git repo I am monitoring was itself\nconverted from an svn repo using, presumably, git-svn or\ngit-svnimport.  It lies at\ngit://gitorious.org/redmine-git/mainline.git\n\nMost patches have an author like this:\n\nAuthor: jplang <jplang@e93f8b46-1217-0410-a6f0-8f06a7374b81>\n\nCould one of the git tools be trying to parse this for some odd\nreason?\n\nOr is something else going on here?\n\n\n"},{"id":"70563","messageId":"slrnfsjim1.5e0.jgoerzen@katherina.lan.complete.org","threadId":"12413","inReplyTo":"slrnfsjfpo.3fl.jgoerzen@katherina.lan.complete.org","subject":"Re: git-rebase dirty index and email address bug?","fromName":"John Goerzen","fromEmail":"jgoerzen@complete.org","sentAt":"2008-03-01T21:29:37Z","receivedAt":"2008-03-01T21:29:37Z","isPatch":false,"sender":{"key":"jgoerzen@complete.org","avatar":null},"body":"On 2008-03-01, John Goerzen <jgoerzen@complete.org> wrote:\n> Hi folks,\n>\n> I have checked out a remote git repo.  I have hacked on my local copy\n> for the last two days.  I have performed no merges or anything elese\n> odd.  Today I git fetched the remote, and then I tried to git rebase\n> upstream/master.  I had committed all outstanding changes first.  My\n> index was clean.  It displayed:\n\nTwo things to add:\n\n1) This was a clean branch prior to rebase (git status was empty)\n\n2) Adding -i to the rebase command, then making no changes to the\nlist, caused the rebase to work perfectly.\n\n\n"},{"id":"70593","messageId":"20080302072622.GB3935@coredump.intra.peff.net","threadId":"12413","inReplyTo":"slrnfsjfpo.3fl.jgoerzen@katherina.lan.complete.org","subject":"Re: git-rebase dirty index and email address bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-03-02T07:26:22Z","receivedAt":"2008-03-02T07:26:22Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Mar 01, 2008 at 02:40:24PM -0600, John Goerzen wrote:\n\n> odd.  Today I git fetched the remote, and then I tried to git rebase\n> upstream/master.  I had committed all outstanding changes first.  My\n> index was clean.  It displayed:\n> \n> First, rewinding head to replay your work on top of it...\n> HEAD is now at 77f1a60... Merge branch 'trunk'\n> Dirty index: cannot apply patches (dirty: public/dispatch.fcgi)\n\nThat seems quite strange, since git-rebase did a \"git-reset --hard\",\nwhich should have cleared your index anyway. And then it runs \"git\nformat-patch | git am\", and \"am\" is responsible for the \"Dirty index\"\nmessage. So perhaps there is something in your commit that is triggering\na bug when piped in this way.\n\nI tried cloning the \"mainline.git\" repository you mentioned and doing a\nfew simple tests, but was unable to reproduce. Can you make available\nthe commits that you are trying to rebase?\n\n> So I tried the git reset command on public/dispatch.fcgi, and also\n> then deleted that file.  I then tried git-rebase --continue, which\n> displayed:\n> \n> sed: can't read .dotest/info: No such file or directory\n> sed: can't read .dotest/info: No such file or directory\n> sed: can't read .dotest/info: No such file or directory\n> Patch does not have a valid e-mail address.\n\nHrm. I don't think it has anything to do with your email address being\ninvalid, but rather that we somehow failed to create the 'info' file\ncontaining information about the commit.\n\n> converted from an svn repo using, presumably, git-svn or\n> git-svnimport.  It lies at\n> git://gitorious.org/redmine-git/mainline.git\n> \n> Most patches have an author like this:\n> \n> Author: jplang <jplang@e93f8b46-1217-0410-a6f0-8f06a7374b81>\n> \n> Could one of the git tools be trying to parse this for some odd\n> reason?\n\nNo, that should parse fine. I think there is something more fundamental\ngoing wrong.\n\n-Peff\n"},{"id":"70594","messageId":"20080302073016.GC3935@coredump.intra.peff.net","threadId":"12413","inReplyTo":"slrnfsjim1.5e0.jgoerzen@katherina.lan.complete.org","subject":"Re: git-rebase dirty index and email address bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-03-02T07:30:16Z","receivedAt":"2008-03-02T07:30:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Mar 01, 2008 at 03:29:37PM -0600, John Goerzen wrote:\n\n> Two things to add:\n> \n> 1) This was a clean branch prior to rebase (git status was empty)\n> \n> 2) Adding -i to the rebase command, then making no changes to the\n> list, caused the rebase to work perfectly.\n\nYes, \"rebase -i\" works somewhat differently than an ordinary rebase. It\nuses a series of cherry-picks rather than \"format-patch | am\". And the\nbug is, I think, in \"git-am\".\n\nIt probably would also have worked using \"git rebase -m\" which uses\nmerge strategies to rebase.\n\nAnd yes, it is a bit crazy that there are so many ways to rebase. The\noriginal, \"format-patch | am\" is faster than the other schemes, but\ndoesn't handle renames (as \"rebase -m\" does); nor is it flexible enough\nto do what \"rebase -i\" does.\n\n-Peff\n"},{"id":"70638","messageId":"200803020744.36591.jgoerzen@complete.org","threadId":"12413","inReplyTo":"20080302073016.GC3935@coredump.intra.peff.net","subject":"Re: git-rebase dirty index and email address bug?","fromName":"John Goerzen","fromEmail":"jgoerzen@complete.org","sentAt":"2008-03-02T13:44:36Z","receivedAt":"2008-03-02T13:44:36Z","isPatch":false,"sender":{"key":"jgoerzen@complete.org","avatar":null},"body":"On Sunday 02 March 2008 1:30:16 am Jeff King wrote:\n> On Sat, Mar 01, 2008 at 03:29:37PM -0600, John Goerzen wrote:\n> > Two things to add:\n> >\n> > 1) This was a clean branch prior to rebase (git status was empty)\n> >\n> > 2) Adding -i to the rebase command, then making no changes to the\n> > list, caused the rebase to work perfectly.\n>\n> Yes, \"rebase -i\" works somewhat differently than an ordinary rebase. It\n> uses a series of cherry-picks rather than \"format-patch | am\". And the\n> bug is, I think, in \"git-am\".\n>\n> It probably would also have worked using \"git rebase -m\" which uses\n> merge strategies to rebase.\n\nI did try that.  The resulting error message was slightly different, but not \nsignificantly so, if I remember correctly.\n\n-- John\n"},{"id":"70735","messageId":"200803022128.14511.jgoerzen@complete.org","threadId":"12413","inReplyTo":"20080302072622.GB3935@coredump.intra.peff.net","subject":"Re: git-rebase dirty index and email address bug?","fromName":"John Goerzen","fromEmail":"jgoerzen@complete.org","sentAt":"2008-03-03T03:28:14Z","receivedAt":"2008-03-03T03:28:14Z","isPatch":false,"sender":{"key":"jgoerzen@complete.org","avatar":null},"body":"On Sunday 02 March 2008 1:26:22 am Jeff King wrote:\n\n> I tried cloning the \"mainline.git\" repository you mentioned and doing a\n> few simple tests, but was unable to reproduce. Can you make available\n> the commits that you are trying to rebase?\n\nThat repo contains some local configuration and password information.  \nHowever, I would be happy to make it available to you or any other Git \ndeveloper privately.  Could you contact me off-list if you'd like me to send \nit to you?  The .git directory in question is about 4.5MB, and I'd be happy \nto email it.\n\n-- John\n"},{"id":"70933","messageId":"20080304120804.GA9042@sigill.intra.peff.net","threadId":"12413","inReplyTo":"200803022128.14511.jgoerzen@complete.org","subject":"Re: git-rebase dirty index and email address bug?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-03-04T12:08:04Z","receivedAt":"2008-03-04T12:08:04Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Mar 02, 2008 at 09:28:14PM -0600, John Goerzen wrote:\n\n> That repo contains some local configuration and password information.  \n> However, I would be happy to make it available to you or any other Git \n> developer privately.  Could you contact me off-list if you'd like me to send \n> it to you?  The .git directory in question is about 4.5MB, and I'd be happy \n> to email it.\n\nI was able to turn this into a much smaller test case.\n\nWhat is happening is that rebase works something like:\n  1. reset to \"onto\" commit\n  2. replay each commit between \"upstream\" and \"branch\"\nbut there is a bug in step 1 that is leaving the bogus\n\"public/dispatch.fcgi\" file in the index and working tree. So step 2\ncorrectly complains that the file is already there and uncommitted.\n\nThe bug in step 1 seems to be very hard to trigger, and requires that\nthe \"branch\" commit and the \"onto\" commit differ such that:\n\n  - there is a file on the branch that was a directory in \"onto\"\n\n  - there is a file on the branch that is new since \"onto\", and that\n    sorts lexically after the file mentioned above\n\nSo you can see that it is rare for it to come up. :)\n\nI'm not sure of the correct fix for the bug, but I have posted a request\nfor help under the subject \"bug in unpack_trees\", so hopefully somebody\nmore wise than I will have something to say.\n\n-Peff\n"},{"id":"70966","messageId":"slrnfsqq9v.njm.jgoerzen@katherina.lan.complete.org","threadId":"12413","inReplyTo":"20080304120804.GA9042@sigill.intra.peff.net","subject":"Re: git-rebase dirty index and email address bug?","fromName":"John Goerzen","fromEmail":"jgoerzen@complete.org","sentAt":"2008-03-04T15:22:39Z","receivedAt":"2008-03-04T15:22:39Z","isPatch":false,"sender":{"key":"jgoerzen@complete.org","avatar":null},"body":"On 2008-03-04, Jeff King <peff@peff.net> wrote:\n>> to email it.\n>\n> I was able to turn this into a much smaller test case.\n>\n\nMany thanks for helping to track this down, Jeff!\n\n-- John\n\n"}]}