OK, sorry, I was not aware that Change-Id's can now be reused for different repositories or branches. I based my assumptions on my experience with previous versions and the current documentation, which are both outdated. The fact that Change-Id's are not unique anymore is also kind of counter-intuitive.
About the documentation, I propose the following change to bring it up-to-date:
https://gerrit-review.googlesource.com/#/c/53330/I didn't generate the HTML yet because I don't know how to do it, but comments on the content are welcome.
Does anyone know when this change has been introduced ? I can also add this information to the documentation. I couldn't find it after a quick check in the release notes of the major releases.
About the use-case "Pushing the same change for different branches", it's OK from a Change-Id perspective, but the following check still gets in the way:
! [remote rejected] HEAD -> refs/publish/master2 (no new changes)
error: failed to push some refs to 'ssh://gerrit/repository'
This check should also be made branch specific, shouldn't it ?
Here is the protocol of the use case:
$ git log -1
commit c09a04b49cfb83801e64e1c142e51457c4328560
Author: Olivier Croquette <
ocroq...@free.fr>
Date: Thu Dec 19 09:18:54 2013 +0100
Testing multiple uploads with the same Change-Id
Change-Id: I6ae866873d590c61d3f921c5a633ba24fdf93ce9
$ git push origin HEAD:refs/publish/master
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 369 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote:
https://gerrit/59remote:
To ssh://gerrit/repository
* [new branch] HEAD -> refs/publish/master
$ git push origin HEAD:refs/publish/master2
Total 0 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done
To ssh://gerrit/repository
! [remote rejected] HEAD -> refs/publish/master2 (no new changes)
error: failed to push some refs to 'ssh://gerrit/repository'
$ git commit --amend
$ git log -1
commit 94dc6b16e048919e58f1e19696b882a4789b9bdf
Author: Olivier Croquette <
ocroq...@free.fr>
Date: Thu Dec 19 09:18:54 2013 +0100
Testing multiple uploads with the same Change-Id
Dummy line to get a new commit id
Change-Id: I6ae866873d590c61d3f921c5a633ba24fdf93ce9
$ git push origin HEAD:refs/publish/master2
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 395 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2)
remote: Processing changes: new: 1, refs: 1, done
remote:
remote: New Changes:
remote:
https://gerrit/60remote:
To ssh://gerrit/repository
* [new branch] HEAD -> refs/publish/master2