We have a project that just moved from an Atlassian Stash server to our Gerrit server. After this migration, a user tried to merge recent changes from master into some other branch he's working on. Some of the changes he needs to merge were from before the migration, and some were from after. After his merge, he was unable to push to the Gerrit server because some of the commits he just merged are missing Change-Ids.
This isn't surprising, because those commits were committed into the repository while it was still hosted on something other than a Gerrit server (still git, but it didn't use Change-Ids).
The project is configured to require Change-Ids in commit messages. It's well understood why this is happening, but I'm uncertain what we should do about it. So far the best idea I've got is to temporarily change the config on this project to not require a Change-Id in commit message when one of these merges fails, then turn that config setting back on after it gets pushed. Is there a better approach that I'm missing?
--thanks,--Andrew
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Tue, Jan 24, 2017 at 2:13 AM, euphxenos <euph...@gmail.com> wrote:We have a project that just moved from an Atlassian Stash server to our Gerrit server. After this migration, a user tried to merge recent changes from master into some other branch he's working on. Some of the changes he needs to merge were from before the migration, and some were from after. After his merge, he was unable to push to the Gerrit server because some of the commits he just merged are missing Change-Ids.Commits which are already merged into a branch (in Gerrit) will not cause creation of a new change... unless you enabledthe "Create a new change for every commit not in the target branch" for that project.This isn't surprising, because those commits were committed into the repository while it was still hosted on something other than a Gerrit server (still git, but it didn't use Change-Ids).The project is configured to require Change-Ids in commit messages. It's well understood why this is happening, but I'm uncertain what we should do about it. So far the best idea I've got is to temporarily change the config on this project to not require a Change-Id in commit message when one of these merges fails, then turn that config setting back on after it gets pushed. Is there a better approach that I'm missing?I guess that all existing commits should be just imported into Gerrit without pushing them for code-review?Are you trying to import by pushing everything to refs/for/master? Why?
On Wednesday, January 25, 2017 at 5:36:03 AM UTC-8, zivkov wrote:On Tue, Jan 24, 2017 at 2:13 AM, euphxenos <euph...@gmail.com> wrote:We have a project that just moved from an Atlassian Stash server to our Gerrit server. After this migration, a user tried to merge recent changes from master into some other branch he's working on. Some of the changes he needs to merge were from before the migration, and some were from after. After his merge, he was unable to push to the Gerrit server because some of the commits he just merged are missing Change-Ids.Commits which are already merged into a branch (in Gerrit) will not cause creation of a new change... unless you enabledthe "Create a new change for every commit not in the target branch" for that project.This isn't surprising, because those commits were committed into the repository while it was still hosted on something other than a Gerrit server (still git, but it didn't use Change-Ids).The project is configured to require Change-Ids in commit messages. It's well understood why this is happening, but I'm uncertain what we should do about it. So far the best idea I've got is to temporarily change the config on this project to not require a Change-Id in commit message when one of these merges fails, then turn that config setting back on after it gets pushed. Is there a better approach that I'm missing?I guess that all existing commits should be just imported into Gerrit without pushing them for code-review?Are you trying to import by pushing everything to refs/for/master? Why?No we're not trying to import by pushing everything to refs/for/master, we've already got the entire repository imported.
We did a git clone --mirror from the old Stash server, then pushed that into the new Gerrit server. After that was done and the repo was on our Gerrit server, we set up the permissions, and a user is now trying to do a git merge from master into another branch and push the results of that merge back to the Gerrit server.
Changes to his target branch are supposed to go through code review. Since his merge straddles changes from either side of the migration,
some of them have Change-Ids and some don't. Going forward, new changes will have Change-Ids, which is why I really don't want to turn off requiring them in the config for that repo.This seems like it would be a pretty common issue for a projecting migrating into Gerrit. How have others handled it?