{"thread":{"id":"7368","subject":"Rebase will throw away log messages","startedAt":"2007-03-23T15:11:22Z","lastAt":"2007-03-23T15:11:22Z","messageCount":1,"participants":["Andy Parkins"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37817","messageId":"200703231511.24397.andyparkins@gmail.com","threadId":"7368","inReplyTo":null,"subject":"Rebase will throw away log messages","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-03-23T15:11:22Z","receivedAt":"2007-03-23T15:11:22Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Hello,\n\nThe thread \"[PATCH] have merge put FETCH_HEAD data in commit message\" reminded \nme of a test I wanted to do after Junio told me off ;-) for putting \"--- \n>8 ---\" in a log message.  In particular, the objection was that the \"---\" \nmade git-am think the message was at an end.  This combined with the talk of \ngit-am in the above thread made me remember that I had more to say about \ngit-am being so picky about what it would allow in the log message.\n\nI just made a repository that looked like this:\n\n * -- * (somebranch)\n  \\\n   X (master)\n\nThen I did a rebase, while on master\n\n $ git rebase somebranch\n\nGreat; rebase worked as expected in terms of reorganising the repository:\n\n * -- * (somebranch)\n       \\\n        X' (master)\n\nThe only thing is this change in the log.  Here is X before the rebase:\n\ncommit 3030bf9e3f8434dc3634e768f5e0bd54659bed48\nAuthor: Andy Parkins <andyparkins@gmail.com>\nDate:   Fri Mar 23 14:49:24 2007 +0000\n\n    Short log\n    \n    Long log; line following this has dashes in it\n    \n    ---\n    \n    This is after the dashes.\n\nHere is X after the rebase:\n\ncommit 575e0c226117d687ae9ba1c3c6b4c8e35cbe5ab7\nAuthor: Andy Parkins <andyparkins@gmail.com>\nDate:   Fri Mar 23 14:49:24 2007 +0000\n\n    Short log\n    \n    Long log; line following this has dashes in it\n\nOh dear.  Half the log message has gone missing.\n\nOf course the reason will be obvious to you clever chaps: git-rebase uses \ngit-am to do the work and the \"---\" line in the original message causes it to \ndrop into \"diff starts here mode\", and then everything until the \"diff --git\" \nline is ignored.\n\nSurely git-am needs a better way of detecting the end of the log that that? \n\nSomething more unique than \"---\" would be a start; \"--- [end of log message]\" \nsort of thing.\n\nAlthough they aren't liked on the git list - emails with the different parts \nas different attachments would be a much more reliable input for git-am for \nuse in git-rebase.\n\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"}]}