{"thread":{"id":"20684","subject":"Rebase with filters","startedAt":"2009-08-21T09:41:55Z","lastAt":"2009-08-21T09:41:55Z","messageCount":1,"participants":["Nigel Magnay"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"121408","messageId":"320075ff0908210241g64fe224dkba1c5d499663c84e@mail.gmail.com","threadId":"20684","inReplyTo":null,"subject":"Rebase with filters","fromName":"Nigel Magnay","fromEmail":"nigel.magnay@gmail.com","sentAt":"2009-08-21T09:41:55Z","receivedAt":"2009-08-21T09:41:55Z","isPatch":false,"sender":{"key":"nigel.magnay@gmail.com","avatar":"https://gravatar.com/avatar/d85cf38287bef3a8e4fa02358d2756d7589f8676c5eeb881ce2f6d731e4526c3?d=mp&s=160"},"body":"Hello. I seem to be doing something wrong - that has previously caused\nme to loose data (well, not really, the commit was still there, but it\ntook me a while to notice - gotta love the non-destructive nature of\ngit)\n\nI have a project that contains a file that, irritatingly, an IDE will\nalways re-format on save, even if there are no changes. So, I use a\nclean and smudge filter to re-order it into a sane format that's\neasier to detect if there have actually been changes.\n\nSo far, so good. But, not everyone always uses this filter, and I get\nsome unexpected behavior when doing a 'git rebase'. For example - the\nrepository starts with a commit that has been sanely-ordered. I make a\nchange of several files, and commit locally - but when I come to push,\nI find that origin/master has moved.\n\nNo worries, I do\ngit fetch\ngit rebase origin/master\n\nNow I see the usual text going past, and including:\n\n....\nerror: realtime/modules/realtime-flex-components/.flexLibProperties:\ndoes not match index\nUsing index info to reconstruct a base tree...\n<stdin>:59: trailing whitespace.\n\n<stdin>:81: trailing whitespace.\n\t\t\t\n<stdin>:83: trailing whitespace.\n\t\t\t\tparameters:[\t\t\t\t\t\n<stdin>:98: space before tab in indent.\n   \t\t\t\tif (item.value == null )\n<stdin>:99: space before tab in indent.\n   \t\t\t\t{\nwarning: squelched 214 whitespace errors\nwarning: 219 lines add whitespace errors.\nFalling back to patching base and 3-way merge...\nerror: Entry 'realtime/modules/realtime-flex-components/.flexLibProperties'\nnot uptodate. Cannot merge.\nfatal: merging of trees 85b26f7c165c2a9d362340187b79527428b650e8 and\n3ab3078b55e17dcb1f3f4c8e6a65eff517eedb92 failed\nFailed to merge in the changes.\nPatch failed at 0001 More KPI/Report work\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 restore the original branch and stop rebasing run \"git rebase --abort\".\n\n\nOK - looking a bit closer, someone committed .flexLibProperties\nwithout the filter. I guess that's the \"does not match index\". Let's\nmerge..\n\n (|REBASE) $ git mergetool\nNo files need merging\n\n\nInteresting - I guess there were no conflicts when the filtering was\nall done. Let's just look at the status..\n\n (|REBASE) $ git status\n# Not currently on any branch.\n# Changed but not updated:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n#\tmodified:   realtime/modules/realtime-flex-components/.flexLibProperties\n\n\nEek... Where's the rest of my files?!\n\nMy guess is that the \"error\" reported further up ought to terminate\nthe rebase without giving me the \"When you have resolved this problem\nrun \"git rebase --continue\" because otherwise I end up loosing the\nmajority of the changes in my rebased commit.. ?\n"}]}