Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to group repositories by means of reg exp #323

gitblit opened this issue Aug 12, 2015 · 5 comments

Ability to group repositories by means of reg exp #323

gitblit opened this issue Aug 12, 2015 · 5 comments


Copy link

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 27

This is not a defect but a suggestion.

I know it is currently possible to group repositories by means of subfolders, but that
approach is not always optimal because it does not match very well with gitolite (which
AFAIK requires all repositories to be included in a single folder). One could overcome
this problem by making use of file system links, by recreating a tree directory structure
containing links to repos physically locate elsewhere, and having gitblit point to
the new tree directory structure instead of using the actual (flat) repository folder.
However this is inconvenient when a new repository is created, because the admin must
remember to create the new link as well.

This is why I believe it would be useful to be able to group repositories by name.

For example, a configuration property such as:

groupRegExp=aaaa\..* bbbb\.*

may be used to tell gitblit to group repositories in two groups, one consisting of
all repositories starting with "aaaa.", the other consisting of the repositories starting
with "bbbb." and gitblit may implicitly create an additional group "others" to group
repositories whose name does not match any of the declared groups.

When such an options is enabled, the web fronted should offer a main page where the
user sees only the list of groups as links, and then the user can click on a group
name to go to the index page which shows the list of all repositories included in such
group. Gitblit should also compute the repository size only on the second page and
this would speed up the time needed to access a repository.

An alternative approach could consist in being able to filter out repositories by means
of a url request. For example, the following URL http://gitblit/summary/?r= displays
the list of all repositories, and the following url http://gitblit/summary/?r=reponame
takes the user to the homepage of the specified repository. It would be useful to be
able to invoke an url such as http://gitblit/summary/?r=aaaa. to be taken to a page
that lists all repositories starting with "aaaa.".

Reported by gm.romanato on 2011-10-21 10:52:35

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I was thinking of supporting repository tags and defining some sort of "group by tag"
and "view tag" pages.  This is not exactly what you are asking for but I don't know
if I would support RegExp grouping.  I hadn't considered that.

If you really want to group by name, why don't you switch web.repositoryListType from
"grouped" to "flat".

You can also double-check repository size calculation time by temporarily disabling
web.showRepositorySizes to see how the calculation impacts page load performance. 
Maybe I'll add some logging info to indicate the time required for calculation so that
users can make an educated decision on if it hurts performance or not.

Reported by James.Moger on 2011-10-21 11:55:20

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

The next release will have a per-repository setting to skip size calculation, will indicate
the time spent calculating size, and will cache/reuse the last size if the repository
is not modified in the interim.

Reported by James.Moger on 2011-10-22 13:03:59

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I'm going to implement a url parameter to _filter_ (but not group) the repositories
list.  It will not be a real regex as that introduces all sorts of encoding issues.

The repository list will support simple fuzzy matching, listing by federation set,
and perhaps one or two other filters, TBD.

Reported by James.Moger on 2011-12-08 22:05:49

  • Status changed: Accepted
  • Labels added: Milestone-0.8.0

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

v0.8.0 released.

I did not implement navigation as you had suggested.  For the time-being I consider
this to be a closed issue.  Try the new release and tell me what you think.

Reported by James.Moger on 2012-01-11 21:46:20

  • Status changed: Fixed

Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Looks good to me. The fact that once set a filter is "sticky" and applies not only to
"repositories" but also to "activity" perfectly matches my needs.

Plus, it can be used in bookmarks!


Reported by gm.romanato on 2012-01-13 14:04:25

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 0.8.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants