Gerrit 3.7.0 cause issue when git commit --amend

186 views
Skip to first unread message

Guy Levkowitz

unread,
Feb 7, 2023, 11:17:34 AM2/7/23
to Repo and Gerrit Discussion
Hi

we have issue when we do :
git add new-file
git commit -m"new file"
git push ....

after what we do :
edit again the same file for example
git add new-file
git commit --amend   (the vi edit mode is open and i just jet out from it - without any changes)
git log -2  (and i can see two Change-ID)  see attached print screen


to check this - i have created  new clone replace the .git/hooks/commit-msg  with old clone that i have old .git/hooks/commit-msg  and rerun the same command - this time it works fine - didn't had the two lines in the Change-ID


what can be done ? 



gerrit_commit--amend.png

Guy Levkowitz

unread,
Feb 7, 2023, 11:38:24 AM2/7/23
to Repo and Gerrit Discussion
I have done diff see the attached between 3.7.0  to 3.6.1  of commit-msg hook



ב-יום שלישי, 7 בפברואר 2023 בשעה 18:17:34 UTC+2, ‪Guy Levkowitz‬‏ כתב/ה:
commit-msg_diff_3.7.0_3.6.1.jpg

Guy Levkowitz

unread,
Feb 8, 2023, 4:28:51 AM2/8/23
to Repo and Gerrit Discussion
we have found that it happens on the old git version : 2.11.0   
on the new git version, it doesn't happen.



ב-יום שלישי, 7 בפברואר 2023 בשעה 18:38:24 UTC+2, ‪Guy Levkowitz‬‏ כתב/ה:

Björn Pedersen

unread,
Feb 9, 2023, 2:46:19 AM2/9/23
to Repo and Gerrit Discussion
sil...@gmail.com schrieb am Mittwoch, 8. Februar 2023 um 10:28:51 UTC+1:
we have found that it happens on the old git version : 2.11.0   
on the new git version, it doesn't happen.


git 2.11 is probably too old and does not provide `git interp-trailers'. It was added in git 2.22 ( released june 2019), 2.11  was release Nov 2016,  I am not surprised that things don't work. 
Reply all
Reply to author
Forward
0 new messages