[Cosmetic] Commiting a gerrit ChangeId before the commit hook was installed generates confusing message

Bug #1270301 reported by strainu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-review
New
Undecided
Unassigned

Bug Description

I was trying to send a new version of a patch to a gerrit server from
a new computer, so I made a change with a ChangeId in the description
and tried to review it:

strainu@emily:~/core> git branch archivebot
strainu@emily:~/core> git checkout archivebot
M pywikibot/page.py
Switched to branch 'archivebot'
strainu@emily:~/core> git diff
strainu@emily:~/core> git add .
strainu@emily:~/core> git commit
[archivebot 282ad24] Update getFileVersionHistoryTable.
 1 file changed, 3 insertions(+), 4 deletions(-)
strainu@emily:~/core> git review -f
Creating a git remote called "gerrit" that maps to:
        ssh://<email address hidden>:29418/pywikibot/core.git
Your change was committed before the commit hook was installed.
Amending the commit to add a gerrit change id.

At this point I ended the transaction, as I was confused by the last
message: I was afraid the ChangeId would have changed, causing the
patch to be attached to another review.

According to a message from the git mailing list, this is a message from git_review/cmd.py

I think git-review should not show this message if the change description
already has a change id, or at least add another message that
clarifies the fact that the change id has not changed.

Revision history for this message
strainu (strainu) wrote :

Having looked at the code, I believe the best way forward would be to change that message to: "Amending the commit to add a gerrit change id if none is available."

Revision history for this message
strainu (strainu) wrote :

And the patch for that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.