TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Gogit – Just enough Git (in Go) to push itself to GitHub

176 pointsby benhoytalmost 2 years ago

7 comments

diarrheaalmost 2 years ago
The other day I was trying to work with git LFS. I was very surprised to find out git-lfs, as in the binary, CLI application is the <i>only</i> (open) implementation in existence. There is nothing else. And even it itself does not offer itself up as a library; so even native Go code (the implementation language) has to fall back to shelling out to the CLI git extension! Not even bindings are possible. Such a painful loss of interoperability: IPC via return codes and parsing stdout&#x2F;stderr.<p>It seems a similar story with the rest of git. I have hopes for gitoxide aka gix, and think the approach of library-first is correct going into the future. A CLI is then simply a thin wrapper around it, mapping argv to library operations basically.
评论 #36928114 未加载
评论 #36926109 未加载
评论 #36928939 未加载
评论 #36928871 未加载
评论 #36929416 未加载
评论 #36926516 未加载
评论 #36924788 未加载
Smaug123almost 2 years ago
Personally I soldiered on to to the point of being able to extract objects from packfiles, before I realised just how monstrously and tediously complex `git rev-parse` is, and gave up. It&#x27;s foundational to pretty much every porcelain command, so it&#x27;s not really something you can leave out if you want a semi-functioning `git`. See <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-rev-parse#_specifying_revisions" rel="nofollow noreferrer">https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-rev-parse#_specifying_revisions</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;ee48e70a829d1fa2da82f14787051ad8e7c45b71&#x2F;refs.c#L732">https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;ee48e70a829d1fa2da82f1478705...</a> ; `git` really is an edifice.
38almost 2 years ago
I have been wanting something like this, but with a few more features such as &quot;git diff&quot;. I took a crack at it, but the popular (and maybe only) Go Git implementation has some issues:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;go-git&#x2F;go-git&#x2F;issues&#x2F;700">https:&#x2F;&#x2F;github.com&#x2F;go-git&#x2F;go-git&#x2F;issues&#x2F;700</a>
评论 #36925363 未加载
评论 #36925813 未加载
c7DJTLrnalmost 2 years ago
&gt;The verbosity of Go’s error handling has been much-maligned. It’s simple and explicit, but every call to a function that may fail takes an additional three lines of code to handle the error<p>Putting error nil checks into a function is an anti-pattern in Go. There is no need to worry about the LOC count of your error checking code.<p>inb4 this ends up on pcj
评论 #36926964 未加载
评论 #36925152 未加载
评论 #36928965 未加载
JaDoggalmost 2 years ago
Nice, I&#x27;m liking the python version too. Good stuff
amedvednikovalmost 2 years ago
Looks really cool!<p>Any chance you could add `git pull` support as well?
评论 #36929574 未加载
zdgeieralmost 2 years ago
Nice work!