vbrandl / hoc

Generate Hits-of-Code badges for GitHub repositories

Home Page:https://hitsofcode.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for other branch names

GrayJack opened this issue · comments

With a lot of people transitions away from master, it would be cool to be able to get hits of code for other branches names

I think (e.g. haven't actually tested) that it should work for any default branch, as long as it is configured as such. But I'll investigate.

Supporting non-default branches and multiple branches is already on my todo, but I didn't come up with a good concept yet, that doesn't end in race conditions and so on...

The sites keep complaining that it expect a master branch every time I try (I have 2 projects that have another default branch, I tested on those). That was the reason I opened the issue.

I can try again any time if needed

Can you link one of the repos with another default branch? I have an idea that I'll test later.

I implemented support for custom branches and refactored the local caching to support multiple branches per repository in c9a54ed.

Local tests were looking good. Once CI passes and the Docker image is published, I'll deploy the changes on hitsofcode.com.

You can now request a specific branch by passing ?branch=dev on any endpoint (except deleting the cache, this will delete the cache for all branches).

If you find any errors, please hit me up again :)

Edit: I actually have to praise Rust here. This seemed like some major refactoring but it was kinda quick and with some help from the compiler, everything went smoothly :D

Edit2: The new version is up and running. Here you go: https://hitsofcode.com/view/github/GrayJack/janetrs?branch=dev (this edit somehow got lost)

@GrayJack please ping me or just close this issue, if everything works for you.

It's working perfectly!!! Thanks, I'll close the issue 😄