You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So that PR came as a result of me investigating whether or not it would make sense to make a gh extension for auto-generating .gitignore files based on the existing repo. My Go skills aren't there, but maybe you could take a look at integration/implementation and I can contribute?
Just run gh extension create and it'll guide you through setting one up. I am not sure what the best way to integrate what you have in this repo, so maybe you could advise?
@tbjers I was unaware there were extensions for gh, a tool I started using last year. I was unaware gh was written in Go, too. Thanks for bringing this idea!
getignore uses the REST API v3. That API actually has a friendly /gitignore endpoint. That's always going to use the github/gitignore repository and always on main branch.
I wanted getignore to have flexibility in case the user wants to retrieve patterns from a different repository, so it does not use the /gitignore endpoint. If you're using gh as a command, I believe it's worth assuming you want the latest patterns from github/gitignore on main, so this flexibility might seem too roundabout since it'd be easier to just use the /gitignore endpoint.
Also, I looked at gh and it seems it uses the GraphQL API v4. I'm having trouble navigating that API to see if it exposes a similar gitignore resource. If it does, it might be more straightforward to take advantage of that.
@gotgenes I don't think GraphQL has any way to fetch gitignore templates. I think we'd still use the REST API. I like the idea of doing a gh extension though, I think a lot of people would use it if it was available.
So that PR came as a result of me investigating whether or not it would make sense to make a
gh
extension for auto-generating.gitignore
files based on the existing repo. My Go skills aren't there, but maybe you could take a look at integration/implementation and I can contribute?Just run
gh extension create
and it'll guide you through setting one up. I am not sure what the best way to integrate what you have in this repo, so maybe you could advise?For further info, take a look at this extension base for Go:
https://github.com/cli/go-gh
And here's the documentation for creating pre-compiled Go extensions:
https://docs.github.com/en/github-cli/github-cli/creating-github-cli-extensions#creating-a-precompiled-extension-in-go-with-gh-extension-create
Originally posted by @gotgenes in #9 (comment)
The text was updated successfully, but these errors were encountered: