Repository: buildbot/buildbot

Issue:
GitPoller in 3.11.3 is not able to detect changes
We've quite basic [GitPoller](https://github.com/openwrt/buildbot/blob/main/phase1/master.cfg#L352) usage:

```python
GitPoller(
        repo_url,
        workdir=work_dir + "/work.git",
        branches=branchNames,
        pollAtLaunch=True,
        pollinterval=300,
    )
```

it was working in `3.11.1`, but stopped working in `3.11.3`. I've noticed:

```
buildbot.warnings.DeprecatedApiWarning: [3.11.3 and later] pollinterval has been deprecated: please use pollInterval
```

and thus changed the variable to `pollInterval=300`, but it didn't helped.



Discussion:
Thanks for report. This is a likely regression since 3.11.3 included a few changes to gitpoller.
@p12tic I can look into it. Certainly my fault.

Resolving patch:
diff --git a/master/buildbot/changes/gitpoller.py b/master/buildbot/changes/gitpoller.py
--- a/master/buildbot/changes/gitpoller.py
+++ b/master/buildbot/changes/gitpoller.py
@@ -395,7 +395,7 @@ def poll(self):
                     break
 
                 rev = yield self._dovccmd(
-                    'rev-parse', [self._tracker_ref(self.repourl, ref), '--'], path=self.workdir
+                    'rev-parse', [self._tracker_ref(self.repourl, ref)], path=self.workdir
                 )
                 revs[branch] = rev
                 yield self._process_changes(rev, branch)


Test patch:
diff --git a/master/buildbot/test/unit/changes/test_gitpoller.py b/master/buildbot/test/unit/changes/test_gitpoller.py
--- a/master/buildbot/test/unit/changes/test_gitpoller.py
+++ b/master/buildbot/test/unit/changes/test_gitpoller.py
@@ -257,7 +257,6 @@ def test_poll_initial(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'bf0b01df6d00ae8d1ffa0b2e2acbe642a6cd35d5\n'),
@@ -338,7 +337,6 @@ def test_poll_failRevParse(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .exit(1),
@@ -375,7 +373,6 @@ def test_poll_failLog(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -459,7 +456,6 @@ def test_poll_nothingNew(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -516,7 +512,6 @@ def test_poll_multipleBranches_initial(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -524,7 +519,6 @@ def test_poll_multipleBranches_initial(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'9118f4ab71963d23d02d4bdc54876ac8bf05acf2'),
@@ -572,7 +566,6 @@ def test_poll_multipleBranches(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -597,7 +590,6 @@ def test_poll_multipleBranches(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'9118f4ab71963d23d02d4bdc54876ac8bf05acf2'),
@@ -735,7 +727,6 @@ def test_poll_multipleBranches_buildPushesWithNoCommits_default(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -788,7 +779,6 @@ def test_poll_multipleBranches_buildPushesWithNoCommits_true(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -888,7 +878,6 @@ def test_poll_multipleBranches_buildPushesWithNoCommits_true_fast_forward(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -992,7 +981,6 @@ def test_poll_multipleBranches_buildPushesWithNoCommits_true_not_tip(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1088,7 +1076,6 @@ def test_poll_allBranches_single(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1199,7 +1186,6 @@ def test_poll_noChanges(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1247,7 +1233,6 @@ def test_poll_allBranches_multiple(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1272,7 +1257,6 @@ def test_poll_allBranches_multiple(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/release',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'9118f4ab71963d23d02d4bdc54876ac8bf05acf2'),
@@ -1380,7 +1364,6 @@ def test_poll_callableFilteredBranches(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1492,7 +1475,6 @@ def test_poll_branchFilter(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/pull/410/head',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'9118f4ab71963d23d02d4bdc54876ac8bf05acf2'),
@@ -1599,7 +1581,6 @@ def test_poll_old(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1714,7 +1695,6 @@ def test_poll_callableCategory(self):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'4423cdbcbb89c14e50dd5f4152415afd686c5241\n'),
@@ -1839,7 +1819,6 @@ def test_startService_loadLastRev(self):
                 'git',
                 'rev-parse',
                 f'refs/buildbot/{self.REPOURL_QUOTED}/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'fa3ae8ed68e664d4db24798611b352e3c6509930\n'),
@@ -1950,7 +1929,6 @@ async def test_poll_found_head(self):
                 'git',
                 'rev-parse',
                 f'refs/buildbot/{self.REPOURL_QUOTED}/heads/default_branch',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'737b94eca1ddde3dd4a0040b25c8a25fe973fe09\n'),
@@ -2001,7 +1979,6 @@ async def test_poll_found_head_not_found(self):
                 'git',
                 'rev-parse',
                 f'refs/buildbot/raw/{self.REPOURL_QUOTED}/HEAD',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'737b94eca1ddde3dd4a0040b25c8a25fe973fe09\n'),
@@ -2084,7 +2061,6 @@ def test_poll_initial_2_10(self, write_local_file_mock, temp_dir_mock):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'bf0b01df6d00ae8d1ffa0b2e2acbe642a6cd35d5\n'),
@@ -2133,7 +2109,6 @@ def test_poll_initial_2_3(self, write_local_file_mock, temp_dir_mock):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'bf0b01df6d00ae8d1ffa0b2e2acbe642a6cd35d5\n'),
@@ -2241,7 +2216,6 @@ def test_poll_initial_2_10(self, write_local_file_mock, temp_dir_mock):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'bf0b01df6d00ae8d1ffa0b2e2acbe642a6cd35d5\n'),
@@ -2315,7 +2289,6 @@ def test_poll_initial_2_10(self, write_local_file_mock, temp_dir_mock):
                 'git',
                 'rev-parse',
                 'refs/buildbot/' + self.REPOURL_QUOTED + '/heads/master',
-                '--',
             ])
             .workdir(self.POLLER_WORKDIR)
             .stdout(b'bf0b01df6d00ae8d1ffa0b2e2acbe642a6cd35d5\n'),