On Wed, Jun 27, 2018 at 8:11 PM Volker Braun <vbraun.n...@gmail.com> wrote:
>
> I'm fine with auto-deleting merged branches, but IMHO thats just doctoring 
> around the symptoms. Listing all branches is just a fundamentally useless 
> view of the repo, akin to listing all your files alphabetically. Even if we 
> auto-delete merged branches there will always be crud because some branches 
> are just intentionally abandoned. We can make the list of branches smaller, 
> but that doesn't change the fact that the signal-to-noise ratio tends to 0 as 
> time increases.

I disagree that it's a "fundamentally useless view of the repo".
Sometimes I'm looking for a specific branch and don't know the exact
name, but know I would recognize it when I see it.  Sometimes this is
a problem even with my own branches which is why I try to regularly
clean up ones I don't need anymore.

Even if listing all branches in the repository were useless (it isn't)
it's certainly useful to clean up one's own branches, so this is a
good pointer for people to have (and perhaps useful to have in `git
trac`).


> In cgit you can set enable-remote-branches=0, though I'm not sure if thats 
> the right option to fix the drop-down.

It's not.

> On Wednesday, June 27, 2018 at 12:53:30 PM UTC+2, Erik Bray wrote:
>>
>> 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.

-- 
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