Does Gogs support filtering repositories by type? Getting the answer from source code.

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Does Gogs support filtering repositories by type? Getting the answer from source code.

Does Gogs support filtering repositories by type? Getting the answer from source code.

by harlanji » Wed Aug 09, 2023 4:43 pm

The best way to get an answer to a question about software is to read the source code.

I am populating my Git server with repos, both original and mirrors. I'm using Gogs which clones GitHub that allows filtering repositories by type in the way I desire.

I try adding ?type=source to my query string, no luck. I try adding /source to the URL and no luck.

Gogs is written in Go which I used a long time ago. Still, I ventured to the source repo and started looking around. Nothing looked like a web app source directory so I clicked internal, success. I looked at the profile page and found a distinctive string to search for, "ui repository list." I found it used in a template, "repo_list." I searched for "repo_list" and found it used in "templates/user/profile.tmpl," noticing the syntax of how a template is included. I searched for "user/profile" and found "internal/route/user/profile.go" with a function for Profile. I clicked into it and found 'c.Query("tab")' and looked around the route's code and don't see anything to do with repo types.

So unless there's some magic happening like an aspect, there's no way to filter repositories by type.

Source code, the best documentation.

Top