Amphtml: `git fetch` is being slowed down by the large number of stale `upstream` branches

Created on 26 Jun 2018  路  10Comments  路  Source: ampproject/amphtml

A part of the daily AMP development workflow is to run git fetch against https://github.com/ampproject/amphtml (which is typically mapped to upstream). I've noticed that doing a fetch has been getting slower over time, and prints a growing number of branch names each time.

On looking at https://github.com/ampproject/amphtml/branches, I noticed the following:

  • We have more than 200 branches on the main repo, most of them over a year old
  • Most of them are amp-release branches, and were created during past releases
  • A large number (stale and current) belong to a few individuals who appear to be creating branches on the main AMP repo

A couple groups of questions:

  1. amp-release branches:

    • Is there any reason to keep the old amp-release branches?

    • Can they be cleaned up after the respective releases are complete?

  2. non-amp-release branches:

    • The dev docs recommend forking the main AMP repository. Is there any advantage to developing directly from the ampproject/amphtml main repo?

    • Are there circumstances under which that's the only (or preferable) option? (Edit: Modifying docs files is one instance where it's easier to work on the main branch.)

    • Would you be okay if your stale branches were cleaned up?

    • And would you consider doing normal development on a fork instead of on the main repo?

infra

Most helpful comment

My use case was editing a documentation file directly from GitHub, to enjoy their editor and markup diff / preview mode.
We should delete the branches once they're merged. My branches can be cleaned up.

All 10 comments

/to @cramforce @mrjoro @erwinmombay for comment on question group 1
/cc @aghassemi @ericlindley-g @bradfrizzell @gmajoulet @jasti @newmuis @kristoferbaxter @pbakaus @rudygalfi for comment on question group 2, since you each have multiple branches on the main repo

My use case was editing a documentation file directly from GitHub, to enjoy their editor and markup diff / preview mode.
We should delete the branches once they're merged. My branches can be cleaned up.

Same response on my end as @gmajoulet 's

Once the branches for changes made via the Github UI have been merged I have no issue with deleting them.

Edit: spelling mistake

I'm in the same boat as @ericlindley-g and @gmajoulet. No issue with it being cleaned up.

Same

+1 to what others have said, let's aggressively delete branches with changes that have already been merged.

I'd even be okay deleting old branches off the main repo even if they haven't been merged, ideally with a courtesy notice to the creators. My understanding is that it is possible restore deleted branches right?

For the release branches I defer to @erwinmombay and you (@rsimha), though if it is possible to undeleted old branches then I'd lean towards deleting them.

Great, thanks all. I'll do a one-time clean up for now, and we can come up with a way of periodically paring down the number of branches on our main repo.

Update: I've done a one-time delete of all stale / unused branches. We can keep an eye on the number of branches over time and see if they continue to accumulate.

For posterity, this was the result of my most recent git fetch command:

From github.com:ampproject/amphtml
 - [deleted]             (none)     -> upstream/1499895693143
 - [deleted]             (none)     -> upstream/1513979839742
 - [deleted]             (none)     -> upstream/1517876307637
 - [deleted]             (none)     -> upstream/1518142615483
 - [deleted]             (none)     -> upstream/a4a_verify_race_fix
 - [deleted]             (none)     -> upstream/aghassemi-patch-1
 - [deleted]             (none)     -> upstream/aghassemi-patch-10
 - [deleted]             (none)     -> upstream/aghassemi-patch-11
 - [deleted]             (none)     -> upstream/aghassemi-patch-12
 - [deleted]             (none)     -> upstream/aghassemi-patch-13
 - [deleted]             (none)     -> upstream/aghassemi-patch-2
 - [deleted]             (none)     -> upstream/aghassemi-patch-2-1
 - [deleted]             (none)     -> upstream/aghassemi-patch-3
 - [deleted]             (none)     -> upstream/aghassemi-patch-4
 - [deleted]             (none)     -> upstream/aghassemi-patch-5
 - [deleted]             (none)     -> upstream/aghassemi-patch-6
 - [deleted]             (none)     -> upstream/aghassemi-patch-7
 - [deleted]             (none)     -> upstream/aghassemi-patch-8
 - [deleted]             (none)     -> upstream/aghassemi-patch-9
 - [deleted]             (none)     -> upstream/amp-release
 - [deleted]             (none)     -> upstream/amp-release-01-08-2018
 - [deleted]             (none)     -> upstream/amp-release-02-05-2018
 - [deleted]             (none)     -> upstream/amp-release-02-07-2018
 - [deleted]             (none)     -> upstream/amp-release-02-09-2018
 - [deleted]             (none)     -> upstream/amp-release-03-06-2017
 - [deleted]             (none)     -> upstream/amp-release-03-06-2017-2
 - [deleted]             (none)     -> upstream/amp-release-03-13-2017
 - [deleted]             (none)     -> upstream/amp-release-03-14-2017-rtv-slice-1
 - [deleted]             (none)     -> upstream/amp-release-03-15-2017-canary-with-PR-8111
 - [deleted]             (none)     -> upstream/amp-release-03-15-2017-rtv-slice-2
 - [deleted]             (none)     -> upstream/amp-release-03-16-2018
 - [deleted]             (none)     -> upstream/amp-release-03-17-2017
 - [deleted]             (none)     -> upstream/amp-release-03-19-2018
 - [deleted]             (none)     -> upstream/amp-release-03-20-2017
 - [deleted]             (none)     -> upstream/amp-release-03-21-2018-canary
 - [deleted]             (none)     -> upstream/amp-release-03-21-2018-prod
 - [deleted]             (none)     -> upstream/amp-release-03-22-2017
 - [deleted]             (none)     -> upstream/amp-release-03-28-2017-canary-patch
 - [deleted]             (none)     -> upstream/amp-release-03-30-2017-canary-patch-1
 - [deleted]             (none)     -> upstream/amp-release-04-05-2018
 - [deleted]             (none)     -> upstream/amp-release-04-06-2018
 - [deleted]             (none)     -> upstream/amp-release-04-07-2017
 - [deleted]             (none)     -> upstream/amp-release-04-11-2017
 - [deleted]             (none)     -> upstream/amp-release-04-12-2017
 - [deleted]             (none)     -> upstream/amp-release-04-18-2017
 - [deleted]             (none)     -> upstream/amp-release-05-10-2017
 - [deleted]             (none)     -> upstream/amp-release-05-12-2017
 - [deleted]             (none)     -> upstream/amp-release-05-12-2017-canary
 - [deleted]             (none)     -> upstream/amp-release-05-15-2017
 - [deleted]             (none)     -> upstream/amp-release-05-16-2017
 - [deleted]             (none)     -> upstream/amp-release-05-18-2018
 - [deleted]             (none)     -> upstream/amp-release-05-22-18
 - [deleted]             (none)     -> upstream/amp-release-05-24-2017
 - [deleted]             (none)     -> upstream/amp-release-05-25-2017
 - [deleted]             (none)     -> upstream/amp-release-05-30-2017
 - [deleted]             (none)     -> upstream/amp-release-06-05-2018
 - [deleted]             (none)     -> upstream/amp-release-06-07-2018
 - [deleted]             (none)     -> upstream/amp-release-06-12-2018
 - [deleted]             (none)     -> upstream/amp-release-06-14-2018
 - [deleted]             (none)     -> upstream/amp-release-06-15-2018
 - [deleted]             (none)     -> upstream/amp-release-06-19-2018
 - [deleted]             (none)     -> upstream/amp-release-06-21-2017
 - [deleted]             (none)     -> upstream/amp-release-06-22-2018
 - [deleted]             (none)     -> upstream/amp-release-06-26-2017
 - [deleted]             (none)     -> upstream/amp-release-06-30-2017
 - [deleted]             (none)     -> upstream/amp-release-07-11-2017
 - [deleted]             (none)     -> upstream/amp-release-07-19-2017
 - [deleted]             (none)     -> upstream/amp-release-07-25-2017
 - [deleted]             (none)     -> upstream/amp-release-07-29-2017
 - [deleted]             (none)     -> upstream/amp-release-08-01-2017
 - [deleted]             (none)     -> upstream/amp-release-08-08-2017
 - [deleted]             (none)     -> upstream/amp-release-08-08-2017-cherry
 - [deleted]             (none)     -> upstream/amp-release-08-15-2017
 - [deleted]             (none)     -> upstream/amp-release-08-18-2017-canary-cherry
 - [deleted]             (none)     -> upstream/amp-release-08-18-2017-prod-cherry
 - [deleted]             (none)     -> upstream/amp-release-08-24-2017
 - [deleted]             (none)     -> upstream/amp-release-08-25-2017
 - [deleted]             (none)     -> upstream/amp-release-09-12-2017
 - [deleted]             (none)     -> upstream/amp-release-09-13-2017
 - [deleted]             (none)     -> upstream/amp-release-09-25-2017
 - [deleted]             (none)     -> upstream/amp-release-10-02-2017
 - [deleted]             (none)     -> upstream/amp-release-11-17-2017
 - [deleted]             (none)     -> upstream/amp-release-11-27-2017
 - [deleted]             (none)     -> upstream/amp-release-12-07-2017
 - [deleted]             (none)     -> upstream/amp-release-12-19-2017-canary
 - [deleted]             (none)     -> upstream/amp-release-12-19-2017-prod
 - [deleted]             (none)     -> upstream/amp-release-12-20-2017
 - [deleted]             (none)     -> upstream/amp-release-12-20-2017-canary-patch
 - [deleted]             (none)     -> upstream/amp-release-1501025810254-07-27-2017
 - [deleted]             (none)     -> upstream/amp-release-1501087461012-07-27-2017
 - [deleted]             (none)     -> upstream/amp-release-1501195163057-07-27-2017
 - [deleted]             (none)     -> upstream/amp-release-1501211869113-07-28-2017
 - [deleted]             (none)     -> upstream/amp-release-2017-01-10-prod
 - [deleted]             (none)     -> upstream/amp-release-2017-04-24
 - [deleted]             (none)     -> upstream/amp-release-2017-04-25
 - [deleted]             (none)     -> upstream/amp-release-2017-04-28
 - [deleted]             (none)     -> upstream/amp-release-2017-05-05-canary
 - [deleted]             (none)     -> upstream/amp-release-2017-05-08-canary
 - [deleted]             (none)     -> upstream/amp-release-2017-06-01
 - [deleted]             (none)     -> upstream/amp-release-2017-06-05
 - [deleted]             (none)     -> upstream/amp-release-2017-07-05
 - [deleted]             (none)     -> upstream/amp-release-2017-07-06
 - [deleted]             (none)     -> upstream/amp-release-2017-07-07
 - [deleted]             (none)     -> upstream/amp-release-2017-07-07-prod-patch
 - [deleted]             (none)     -> upstream/amp-release-2017-07-10
 - [deleted]             (none)     -> upstream/amp-release-2017-07-18
 - [deleted]             (none)     -> upstream/amp-release-2017-08-10-1
 - [deleted]             (none)     -> upstream/amp-release-2017-08-29-1
 - [deleted]             (none)     -> upstream/amp-release-2017-09-11-1
 - [deleted]             (none)     -> upstream/amp-release-2017-09-19
 - [deleted]             (none)     -> upstream/amp-release-2017-09-21-1
 - [deleted]             (none)     -> upstream/amp-release-2017-09-21-2-canary
 - [deleted]             (none)     -> upstream/amp-release-2017-10-19-1
 - [deleted]             (none)     -> upstream/amp-release-2017-10-23-1
 - [deleted]             (none)     -> upstream/amp-release-2017-12-22-prod
 - [deleted]             (none)     -> upstream/amp-release-2017-2-16
 - [deleted]             (none)     -> upstream/amp-release-20171103-1
 - [deleted]             (none)     -> upstream/amp-release-2018-01-17-prod
 - [deleted]             (none)     -> upstream/amp-release-2018-01-18-prod
 - [deleted]             (none)     -> upstream/amp-release-2018-01-18-prod-2
 - [deleted]             (none)     -> upstream/amp-release-2018-01-24-prod
 - [deleted]             (none)     -> upstream/amp-release-2018-02-12-prod-1
 - [deleted]             (none)     -> upstream/amp-release-2018-02-27
 - [deleted]             (none)     -> upstream/amp-release-2018-02-27-optin
 - [deleted]             (none)     -> upstream/amp-release-2018-03-21-2-canary
 - [deleted]             (none)     -> upstream/amp-release-2018-03-23-canary
 - [deleted]             (none)     -> upstream/amp-release-2018-03-27
 - [deleted]             (none)     -> upstream/amp-release-2018-03-28
 - [deleted]             (none)     -> upstream/amp-release-2018-03-28-prod
 - [deleted]             (none)     -> upstream/amp-release-2018-03-29
 - [deleted]             (none)     -> upstream/amp-release-2018-04-13
 - [deleted]             (none)     -> upstream/amp-release-2018-04-16
 - [deleted]             (none)     -> upstream/amp-release-2018-04-23-canary
 - [deleted]             (none)     -> upstream/amp-release-2018-04-26-canary
 - [deleted]             (none)     -> upstream/amp-release-2018-05-14
 - [deleted]             (none)     -> upstream/amp-release-2018-05-15
 - [deleted]             (none)     -> upstream/amp-release-2018-31-05
 - [deleted]             (none)     -> upstream/amp-release-2018-31-05-canary
 - [deleted]             (none)     -> upstream/amp-release-bisect
 - [deleted]             (none)     -> upstream/amp-release-canary-02-04-18-2016
 - [deleted]             (none)     -> upstream/amp-release-prod-04-18-2016
 - [deleted]             (none)     -> upstream/amp-scroll-sync
 - [deleted]             (none)     -> upstream/amp-story-nit
 - [deleted]             (none)     -> upstream/amp_bodymovin
 - [deleted]             (none)     -> upstream/ampprojectamp-release-2018-04-23-canary
 - [deleted]             (none)     -> upstream/autoplay-docs
 - [deleted]             (none)     -> upstream/bumpity-bump
 - [deleted]             (none)     -> upstream/camelburrito-patch-2
 - [deleted]             (none)     -> upstream/camelburrito-patch-3
 - [deleted]             (none)     -> upstream/choumx-bind-integration-fail
 - [deleted]             (none)     -> upstream/context-refactor
 - [deleted]             (none)     -> upstream/dev-drprasad-clear-action-for-amp-form
 - [deleted]             (none)     -> upstream/dev_gem
 - [deleted]             (none)     -> upstream/dmm9999-patch-1
 - [deleted]             (none)     -> upstream/docker-builds
 - [deleted]             (none)     -> upstream/document-fonts-error
 - [deleted]             (none)     -> upstream/dvoytenko-patch-1
 - [deleted]             (none)     -> upstream/ericlindley-g-patch-1
 - [deleted]             (none)     -> upstream/ericlindley-g-patch-2
 - [deleted]             (none)     -> upstream/ericlindley-g-patch-3
 - [deleted]             (none)     -> upstream/ericlindley-g-patch-3-1
 - [deleted]             (none)     -> upstream/fade_in_percentage
 - [deleted]             (none)     -> upstream/fade_in_rename
 - [deleted]             (none)     -> upstream/fade_in_scroll
 - [deleted]             (none)     -> upstream/flicker_bug
 - [deleted]             (none)     -> upstream/fly_in
 - [deleted]             (none)     -> upstream/frizz-canonical-adsense-first-pass
 - [deleted]             (none)     -> upstream/frizz-fix-eids
 - [deleted]             (none)     -> upstream/frizz-flicker-fix
 - [deleted]             (none)     -> upstream/frizz-invalid-origin-experiment
 - [deleted]             (none)     -> upstream/frizz-make-error-clearer
 - [deleted]             (none)     -> upstream/frizz-rtc-consent
 - [deleted]             (none)     -> upstream/frizz-rtc-refactor
 - [deleted]             (none)     -> upstream/frizz-update-sf-docs
 - [deleted]             (none)     -> upstream/frizz-update-sf-verison
 - [deleted]             (none)     -> upstream/from-amp-release-2017-07-07
 - [deleted]             (none)     -> upstream/gh
 - [deleted]             (none)     -> upstream/gmajoulet-amp-consent-story-prompt-doc
 - [deleted]             (none)     -> upstream/gmajoulet-patch-1
 - [deleted]             (none)     -> upstream/gmajoulet-patch-3
 - [deleted]             (none)     -> upstream/gulp-branch-diff
 - [deleted]             (none)     -> upstream/honeybadgerdontcare-patch-2
 - [deleted]             (none)     -> upstream/inabox_analytics_priority_0
 - [deleted]             (none)     -> upstream/initial-load-measurement
 - [deleted]             (none)     -> upstream/jasti-patch-1
 - [deleted]             (none)     -> upstream/jasti-patch-2
 - [deleted]             (none)     -> upstream/jasti-patch-3
 - [deleted]             (none)     -> upstream/jasti-patch-4
 - [deleted]             (none)     -> upstream/kmh287-patch-1
 - [deleted]             (none)     -> upstream/kmh287-patch-2
 - [deleted]             (none)     -> upstream/merge-amp-story-core
 - [deleted]             (none)     -> upstream/more-json-types
 - [deleted]             (none)     -> upstream/more-types
 - [deleted]             (none)     -> upstream/mrjoro-cherrypick-docs
 - [deleted]             (none)     -> upstream/mrjoro-exp-devchannel-link
 - [deleted]             (none)     -> upstream/mrjoro-fix-cherrypick-template
 - [deleted]             (none)     -> upstream/mrjoro-update-release-tmpl
 - [deleted]             (none)     -> upstream/newmuis-patch-1
 - [deleted]             (none)     -> upstream/newmuis-patch-10
 - [deleted]             (none)     -> upstream/newmuis-patch-11
 - [deleted]             (none)     -> upstream/newmuis-patch-12
 - [deleted]             (none)     -> upstream/newmuis-patch-13
 - [deleted]             (none)     -> upstream/newmuis-patch-14
 - [deleted]             (none)     -> upstream/newmuis-patch-15
 - [deleted]             (none)     -> upstream/newmuis-patch-16
 - [deleted]             (none)     -> upstream/newmuis-patch-2
 - [deleted]             (none)     -> upstream/newmuis-patch-3
 - [deleted]             (none)     -> upstream/newmuis-patch-4
 - [deleted]             (none)     -> upstream/newmuis-patch-5
 - [deleted]             (none)     -> upstream/newmuis-patch-6
 - [deleted]             (none)     -> upstream/newmuis-patch-7
 - [deleted]             (none)     -> upstream/newmuis-patch-8
 - [deleted]             (none)     -> upstream/newmuis-patch-9
 - [deleted]             (none)     -> upstream/node-4
 - [deleted]             (none)     -> upstream/pbakaus-patch-1
 - [deleted]             (none)     -> upstream/pbakaus-patch-2
 - [deleted]             (none)     -> upstream/pbakaus-patch-3
 - [deleted]             (none)     -> upstream/revert-10403-cv-video
 - [deleted]             (none)     -> upstream/revert-10610-eval-bind-amp-list-render
 - [deleted]             (none)     -> upstream/revert-11034-3qskip
 - [deleted]             (none)     -> upstream/revert-12158-layoutvt
 - [deleted]             (none)     -> upstream/revert-12588-removeexp
 - [deleted]             (none)     -> upstream/revert-15836-performance-test-flaky
 - [deleted]             (none)     -> upstream/revert-16119-16042
 - [deleted]             (none)     -> upstream/revert-16194-unskip/dp-integration
 - [deleted]             (none)     -> upstream/revert-8830-revert-8800
 - [deleted]             (none)     -> upstream/revert-9537-lannka-node-6.10
 - [deleted]             (none)     -> upstream/revert-9682-context-test
 - [deleted]             (none)     -> upstream/rudygalfi-cache-doc-update
 - [deleted]             (none)     -> upstream/rudygalfi-docs-fix
 - [deleted]             (none)     -> upstream/rudygalfi-patch-1
 - [deleted]             (none)     -> upstream/rudygalfi-story-analytics-docs
 - [deleted]             (none)     -> upstream/touch-action
 - [deleted]             (none)     -> upstream/waitfor
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 10 (delta 3), reused 5 (delta 3), pack-reused 0
Unpacking objects: 100% (10/10), done.
 * [new branch]          amp-release-2018-06-26-1-percent -> upstream/amp-release-2018-06-26-1-percent
 + 22ec94bd7...8fc63d8bf gmajoulet-patch-2                -> upstream/gmajoulet-patch-2  (forced update)

Closing for now, will review periodically.

Was this page helpful?
0 / 5 - 0 ratings