Page MenuHomePhabricator

git tags can tag anything, break daemons
Closed, ResolvedPublic

Description

T11180 is an instance of tagging a tag, but git's repo have a tagged blob, which breaks the importing daemon:

$ git cat-file -t  7214aea37915ee2c4f6369eb9dea520aec7d855b
blob
$ git for-each-ref --points-at 7214aea37915ee2c4f6369eb9dea520aec7d855b
3a1c74404d544d20c0d1f0b9c072b471a20b04c0 tag    refs/tags/junio-gpg-pub
EXCEPTION: (Exception) Commit "7214aea37915ee2c4f6369eb9dea520aec7d855b" is not a reachable ancestor of "7214aea37915ee2c4f6369eb9dea520aec7d855b". at [<phabricator>/src/applications/repository/daemon/PhabricatorGitGraphStream.php:88]
arcanist(), phabricator(), phutil()
  #0 PhabricatorGitGraphStream::parseUntil(string) called at [<phabricator>/src/applications/repository/daemon/PhabricatorGitGraphStream.php:38]
  #1 PhabricatorGitGraphStream::getParents(string) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:388]
  #2 PhabricatorRepositoryDiscoveryEngine::discoverStreamAncestry(PhabricatorGitGraphStream, string, boolean) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php:191]
...

Event Timeline

D16149 has this code:

if ($tag_type == 'tag') {
  $this->log(pht('Skipping, this is a tag of a tag.'));
  continue;
}

Maybe the right thing to do is to check for != 'commit' instead?

yeah, I just need to build the right test case...

Everyone got to learn something new about Git today!

Thanks for hunting this down.

there's actually unitests here!