Page MenuHomePhabricator

Undesirable 'push' commits in feed
Closed, DuplicatePublic

Description

We're using gitblit for remote hosting of git repositories. After upgrading to stable, we're seeing odd entries in the feed that coincide with every git push we do to the gitblit repository. Example:

Screenshot at 2016-07-15 13-33-53.png (891×1 px, 78 KB)
where given UPDATE <hash1> <hash2>, hash1 is the previous HEAD of the branch, and has2 is the new HEAD after the push.

I assume this is related to diffusions reflog-handling changes (https://secure.phabricator.com/w/changelog/2016.25/#diffusion), causing it to pick up some type of internal tracking gitblit is doing.

The changelog linked above suggests running ./bin/repository mark-reachable rXYZ in some instances ... it didn't seem like that was the issue for us but I ran it anyway. It reported Examined 74,297 commits already in the correct state..

Is there any way to filter these feed stories, or disable this behavior altogether?

Event Timeline

It's a little concerning that gitblit doesn't host it's own code, instead relying on github. Regardless, I haven't yet found a public gitblit repo that I can point to for reproduction.

Phabricator is looking at all refs, and gitblit is recording some information as refs, which interact strangely.

You can configure the repository track only value to not track refs/meta, which is apparently where gitblit records it's reflog.

Otherwise, this is the same issue as T11314.

You can configure the repository track only value to not track refs/meta, which is apparently where gitblit records it's reflog.

Thanks for the trackOnly suggestion ... we have about 40 repos so I'll give diffusion.repository.edit a try :)

You can configure the repository track only value to not track refs/meta, which is apparently where gitblit records it's reflog.

Hmm, track only doesn't seem to be having any effect against the refs/meta. For now I'm configuring a single repo via the web UI and pushing test commits to verify the result.

I've configured the default branch to be master and I tried the following values for trackOnly.

  • master
  • regexp(/^master/)
  • regexp(/^(?!refs)/)

Pushing to master still resulting in the push commits showing up in our feed. The docs don't say that the daemons needed to be restarted, but I did that too just to be sure.

I also created a test branch, and pushed to it while trackOnly was set to master. In this case the commit itself did not show up in the feed (yay!) but the refs push commit did still show up in the feed (boo!).

It appears that trackOnly really does only apply to branches and not refs, but maybe I'm using it wrong. Any suggestions on what else to try?

It appears that trackOnly really does only apply to branches and not refs

That's possible; We were looking at branches only until very recently, so this one might still talk about branches.

Can you configure gitblit not to expose these refs, or have phabricator observe the github repo (Assuming these refs don't make it there?)?

Can you configure gitblit not to expose these refs, ...

I was not able to find any gitblit configuration around how refs/meta is used. I did however find that gitblit has support for tickets (which we are not using) and [[ http://gitblit.com/tickets_replication.html | it also track them through refs/meta. ]]

... or have phabricator observe the github repo (Assuming these refs don't make it there?)?

Oh I was speaking of the glblit project itself, how it uses github for it's source code hosting, rather than eating it's own dogfood. We are not using github, but we have discussed converting over to directly hosting the repositories in Diffusion.

In the short term I made the following hack to revert part of 2949905c045b603a95be6b43668fb2bb463efe8d, and it's no longer generating the push commits:

diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
index 08fe8ea..4ddcc9d 100644
--- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
@@ -348,7 +348,7 @@ final class PhabricatorRepositoryPullEngine
         // For bare working copies, we need this magic incantation.
         $future = $repository->getRemoteCommandFuture(
           'fetch origin %s --prune',
-          '+refs/*:refs/*');
+          '+refs/heads/*:refs/heads/*');
       } else {
         $future = $repository->getRemoteCommandFuture(
           'fetch --all --prune');