git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Rebase will throw away log messages

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 23, 2007, 15:11 UTC
Message-ID
<200703231511.24397.andyparkins@gmail.com>
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
Message 1 of 1 in “Rebase will throw away log messages”
  1. Andy ParkinsMar 23, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.