gitsubgit

subgit - how to reflect edited SVN log message in git


I'm using subgit to sync my git and SVN repos. I have updated a misleading log message in SVN and I would like that reflected in git. I was wondering if something like this would do the trick:

Am I on the right lines?


Solution

  • You need to retranslate several latest revisions including that one for which you've edited the message. Suppose you've edited message for revision REV and the previous revision

    PREV = REV - 1
    

    In this case the following command should help:

    subgit install --rebuild-from-revision PREV path/to/git/repository
    

    Note that Git SHA-1 hashes will be changed after that.

    The commands you've suggested will result into new SVN revisions without affecting the existing one. In particular git push -f will result into branch/trunk replacement which is not recommended. Prefer --rebuild-from-revision solution.