{"thread":{"id":"38086","subject":"[BUG] git rebase -X fails with merge-recursive error","startedAt":"2014-12-01T14:33:33Z","lastAt":"2014-12-01T14:33:33Z","messageCount":1,"participants":["Øystein Walle"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252778","messageId":"loom.20141201T152914-672@post.gmane.org","threadId":"38086","inReplyTo":null,"subject":"[BUG] git rebase -X fails with merge-recursive error","fromName":"Øystein Walle","fromEmail":"oystwa@gmail.com","sentAt":"2014-12-01T14:33:33Z","receivedAt":"2014-12-01T14:33:33Z","isPatch":false,"sender":{"key":"oystwa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/794585?v=4"},"body":"Hi,\n\nI discovered this while rebasing a branch after having converted files\nto use LF line endings. I got around the problem by using\n--ignore-whitespace but the error still seems strange to me so I'm\nreporting it.\n\nThe following script is equivalent: it creates a repo with a CRLF file,\ncreates a \"feature\" branch, converts the file and then tries to rebase\nthe feature branch with git rebase -X ignore-whitespace-at-eol:\n\n    git init\n    echo \"That's some catch, that Catch-1984\" >file.txt\n    unix2dos file.txt\n    git add file.txt\n    git commit -m 'Initial commit'\n    git checkout -b feature\n    ex -sc 's/1984/22/|x' file.txt\n    git commit -m \"Fix literary confusion\" file.txt\n    git checkout master\n    echo '* text=auto' > .gitattributes\n    dos2unix file.txt\n    git add .\n    git commit -m 'CRLF to LF'\n    git checkout feature\n    gti config merge.renormalize true\n    git rebase -X ignore-space-at-eol master\n\nWhile rebasing the following error appears:\n\n    error: addinfo_cache failed for path 'file.txt'\n\nIt comes from the git-merge-recursive invocation git-rebase performs[1]\nand is printed because make_cache_entry() fails[2]. I also get this\nerror when using the other 'ignore-*' strategy options, as well as\n'theirs'.\n\nAt this point file.txt still has its CRLF terminator, but simply:\n\ngit add file.txt\ngit rebase --continue\n\nhas the desired effect (as it did in my real life situation). I've\ntested this on Git 2.2.0, 2.1.3 and 1.9.0.\n\nI don't know whether this is actually related to git-rebase. It's a way\nto reproduce it if nothing else. I haven't tried any experiments with\ngit-merge-recursive directly, I get the impression I'm not supposed to\nsince it doesn't have a manpage ;) Interestingly, removing the creation\nof .gitattributes makes the problem go away.\n\nAdditionally, git-merge-recursive exits with status 0. This confuses\ngit-rebase which will continue and then complain about the state of the\nindex. (Interestingly, at this point my prompt thingy complains that\n.git/rebase-merge/done isn't there).\n\nRegards,\nØsse\n\n[1]: https://github.com/git/git/blob/master/git-rebase--merge.sh#L70\n[2]: https://github.com/git/git/blob/master/merge-recursive.c#L209\n"}]}