Issue 3197: Submodule subscription doesn't work on 2 changes.
Status:  Released
Owner: ----
Closed:  Apr 2015
Project Member Reported by sbel...@google.com, Feb 19, 2015
Affected Version: current master (v2.10-1647-g97d0735)

What steps will reproduce the problem?
1. First setup a repo and a submodule which is subscribed to commit all its changes to the repo. Validate it works when committing a single change in the submodule.
2. Enable `change.submitWholeTopic` 
3. create 2 changes in te submodule with the same topic. Review them, "submit the whole topic".

What is the expected output? What do you see instead?
I'd expect the submodule to trigger some kind of update of the
superproject to show the advances in the submodule, whether it's two updates or a single update.  Instead nothing happens to the superproject.

Please provide any additional information below.
`change.submitWholeTopic` is rather new, and integrating that together with other features of gerrit is challenging. 
The most convenient would be to have just a single update to the superproject containing the update of the submodule by 2 commits,
also stating the topic and saying it's intentional to have merged 2 changes at the same time.

Feb 19, 2015
Project Member #1 sbel...@google.com
It seems to be a NPE. I am not sure if that is the root cause of this issue though.

[2015-02-19 12:32:06,925] ERROR com.google.gerrit.server.git.ChangeMergeQueue : Merge attempt for testSubD,refs/heads/master failed
java.lang.NullPointerException
	at org.eclipse.jgit.util.RawParseUtils.commitMessage(RawParseUtils.java:1024)
	at org.eclipse.jgit.revwalk.RevCommit.getFullMessage(RevCommit.java:440)
	at com.google.gerrit.server.git.SubmoduleOp.updateSuperProjects(SubmoduleOp.java:230)
	at com.google.gerrit.server.git.SubmoduleOp.update(SubmoduleOp.java:130)
	at com.google.gerrit.server.git.MergeOp.updateSubscriptions(MergeOp.java:840)
	at com.google.gerrit.server.git.MergeOp.merge(MergeOp.java:285)
	at com.google.gerrit.server.git.ChangeMergeQueue$2.call(ChangeMergeQueue.java:208)
	at com.google.gerrit.server.git.ChangeMergeQueue$2.call(ChangeMergeQueue.java:205)
	at com.google.gerrit.server.util.RequestScopePropagator$5.call(RequestScopePropagator.java:222)
	at com.google.gerrit.server.util.RequestScopePropagator$4.call(RequestScopePropagator.java:201)
	at com.google.gerrit.server.git.PerThreadRequestScope$Propagator$1.call(PerThreadRequestScope.java:75)
	at com.google.gerrit.server.git.ChangeMergeQueue.mergeImpl(ChangeMergeQueue.java:205)
	at com.google.gerrit.server.git.ChangeMergeQueue.merge(ChangeMergeQueue.java:123)
	at com.google.gerrit.server.change.Submit.apply(Submit.java:215)
	at com.google.gerrit.server.change.Submit.apply(Submit.java:89)

Feb 19, 2015
Project Member #2 sbel...@google.com
This is spot on. Commenting out the offending line at com.google.gerrit.server.git.SubmoduleOp.updateSuperProjects(SubmoduleOp.java:230)
makes gerrit work again with submodule updates commited in the same topic as super project updates.
Mar 5, 2015
Project Member #3 sbel...@google.com
Attaching a script to reliably reproduce this bug, when having a submodule `submodule` which is subscript to a super project and `submitWholeTopic` is enabled.
Mar 5, 2015
Project Member #4 sbel...@google.com
(No comment was entered for this change.)
up.sh
622 bytes   View   Download
Apr 29, 2015
Project Member #6 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.12
Dec 21, 2015
Project Member #7 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released