Adding sourcehut support should be possible, getting all commits of a user is impossible (atleast i think so)
but getting all of the commits in their own repos is possible.
Graphql query:
query {
me {
repositories(filter: { count: 100 }) {
results {
log {
cursor
results {
author {
email
time
}
}
}
}
}
}
}
curl command:
echo '{
"query": "query {\r\n me {\r\n repositories(filter: { count: 100 }) {\r\n results {\r\n log {\r\n cursor\r\n results {\r\n author {\r\n \temail\r\n time\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n",
"variables": {}
}' | curl --json @- \
--oauth2-bearer "$bearer_token" \
https://git.sr.ht/query
You should enumerate over result["data"]["me"]["repositories"]["results"]
and in each repo enumerate over repo["log"]["results"] and if repo["log"] has a cursor that is not null, you should also go to the next page.
and in each one of THOSE check if commit["author"]["email"] is equal to the user, and then you can take the time with commit["author"]["time"]
It is a lot, and a very nested dict. but it should be possible
Adding sourcehut support should be possible, getting all commits of a user is impossible (atleast i think so)
but getting all of the commits in their own repos is possible.
Graphql query:
curl command:
You should enumerate over
result["data"]["me"]["repositories"]["results"]and in each repo enumerate over
repo["log"]["results"]and ifrepo["log"]has a cursor that is not null, you should also go to the next page.and in each one of THOSE check if
commit["author"]["email"]is equal to the user, and then you can take the time withcommit["author"]["time"]It is a lot, and a very nested dict. but it should be possible