threads / discuss / 7368

Rebase will throw away log messages

Subject: Rebase will throw away log messages

## tl;dr

One message between Mar 23, 2007 and Mar 23, 2007.

replies: 0people: 1as markdown or json

Andy Parkins· Mar 23, 2007, 15:11 UTC · lore
Hello,

The thread "[PATCH] have merge put FETCH_HEAD data in commit message" reminded me of a test I wanted to do after Junio told me off ;-) for putting "---

>8 ---" in a log message.  In particular, the objection was that the "---" 

made git-am think the message was at an end. This combined with the talk of git-am in the above thread made me remember that I had more to say about git-am being so picky about what it would allow in the log message.

I just made a repository that looked like this:
 * -- * (somebranch)
  \
   X (master)
Then I did a rebase, while on master
 $ git rebase somebranch
Great; rebase worked as expected in terms of reorganising the repository:
 * -- * (somebranch)
       \
        X' (master)
The only thing is this change in the log.  Here is X before the rebase:
commit 3030bf9e3f8434dc3634e768f5e0bd54659bed48
Author: Andy Parkins <andyparkins@gmail.com>
Date:   Fri Mar 23 14:49:24 2007 +0000
    Short log
    
    Long log; line following this has dashes in it
    
    ---
    
    This is after the dashes.
Here is X after the rebase:
commit 575e0c226117d687ae9ba1c3c6b4c8e35cbe5ab7
Author: Andy Parkins <andyparkins@gmail.com>
Date:   Fri Mar 23 14:49:24 2007 +0000
    Short log
    
    Long log; line following this has dashes in it
Oh dear.  Half the log message has gone missing.

Of course the reason will be obvious to you clever chaps: git-rebase uses git-am to do the work and the "---" line in the original message causes it to drop into "diff starts here mode", and then everything until the "diff --git" line is ignored.

Surely git-am needs a better way of detecting the end of the log that that? 

Something more unique than "---" would be a start; "--- [end of log message]" sort of thing.

Although they aren't liked on the git list - emails with the different parts as different attachments would be a much more reliable input for git-am for use in git-rebase.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

← back to recent threads