[TYPO3-dev] How to change the GIT commit message of a merged changeset?

Philipp Gampe philipp.gampe at typo3.org
Thu Jul 19 08:28:06 CEST 2012


Hi Oliver,

Oliver Klee wrote:

> for the "phpunit" extension (which already has been switch to use GIT &
> Gerrit), I accidentally used an incorrect ticket number in the commit
> message of a changeset. Unfortunately, this got noticed after I had
> already merged that changeset.
> 
> Is there a way I can change the commit message of that changeset even if
> it already has been merged?

Only if you modify the repository directly on t3o. I do not think there is a 
gerrit way.

If you do this, then you will change the sha1 and thus the commit pointer. 
If this is the topmost commit, then it might work, but if any other commit 
sits on top, then you will create conflicts. This is even worse if someone 
already pulled and worked on top of it.
I would generally advise you not change a commit that has been pushed to a 
public repository (thus merged in gerrit).

It is not a big deal to fix the repository after a commit/merge conflict, 
but it does confuse inexperienced git users.
Easiest fix for the users it to reset the HEAD to the first commit before 
the conflict then rebase into upstream. Any local commit must be saved to a 
temp branch and cherry-picked from there.

Cheers
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
Documentation – linkvalidator
TYPO3 .... inspiring people to share!




More information about the TYPO3-dev mailing list