previous commit message is not added automatically when amending

Chad Kouse October 25, 2011

When I click "amend latest commit" it doesn't seem to add the last commit message (post commit-msg hook) to the commit message text box for me. In my case we use gerrit and there is a unique Change-Id generated in the commit-msg hook that needs to be sent withi any amended changes.

using the command line tools "git commit --amend" does this, as do other GUI clients I have used.

2 answers

0 votes
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2011

Question was actually about restoring the previous commit message when the amend commit option is checked. This is being tracked here: https://jira.atlassian.com/browse/SRCTREE-697

0 votes
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2011

I don't think this would be desired behaviour for most people anyway; when you amend a commit, you want control over what's in the commit message. If your tools like to see change ids, you can add them - but really I don't think amending commits that have already been pushed elsewhere is a good idea anyway.

Chad Kouse October 25, 2011
I should make my question more generic - when I click amend it doesn't put my last commit message into the commit message text box for me. This would automatically include any change-Id tacked on from my commit-msg hook. It seems like I only have the ability to pick an old message that I had typed in (before the hook added its change-id)
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2011

Ah I see - sorry I thought you meant adding the previous commit SHA.

This issue is being tracked here: https://jira.atlassian.com/browse/SRCTREE-697

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events