Hi everyone,

The list of branches that have been pushed to git.sagemath.org is
extremely long.  At my latest count there are 23979 branches on there
(congratulations on everyone's hard work!).

However, leaving up so many old branches is not entirely without
impact.  While merged branches don't ultimately contribute much to the
size of the repository (as all the commits in those branches are
merged into the mainline (master, develop) branches) it still impacts
that efficiency of some of the tooling, especially anything that
involves listing branches.

For example, in the https://git.sagemath.org/ web interface, at the
top of the page is a drop-down list from which one can select a branch
to view, and that list contains all 20,000+ of those branches, which
actually noticeably slows down page loads on some machines.

I would suggest, as often as possible, deleting your branches from
upstream once they've been merged (I myself have been lax about this).
Nothing is lost if you do this for merged branches, because when a
branch attached to a ticket is merged and the ticket closed, the
branch name is actually replaced with the merge commit SHA on the
ticket, so you can still view exactly what was merged for a given
ticket.

Here's a little command line snippet I came up with to delete all my
upstream merged branches (if someone knows a better way please chime
in--I just came up with this without consulting any resources):

$ UPSTREAM="upstream"
$ USERNAME="embray"
$ git branch -r --merged | grep "$UPSTREAM/u/$USERNAME" | sed
's|'$UPSTREAM'/|:|' | xargs git push $UPSTREAM

here just replace "upstream" with whatever your upstream remote is
called for git.sagemath.org (it's more typically "origin") and
"embray" with your trac username.  This just takes the names of all
merged remote branches from $UPSTREAM, strips the $UPSTREAM and
prepends them with ":", and then passes those to "git push".  The
syntax "git push <remote> :<branch-name>" means  to delete the given
branch from the given remote.

I did this just for myself and deleted ~205 branches.  Perhaps
functionality like this could also be added to the git-trac command?

Thanks,
E

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to