TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

176 点作者 benhoyt将近 2 年前

7 条评论

diarrhea将近 2 年前
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 未加载
Smaug123将近 2 年前
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.
38将近 2 年前
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 未加载
c7DJTLrn将近 2 年前
&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 未加载
JaDogg将近 2 年前
Nice, I&#x27;m liking the python version too. Good stuff
amedvednikov将近 2 年前
Looks really cool!<p>Any chance you could add `git pull` support as well?
评论 #36929574 未加载
zdgeier将近 2 年前
Nice work!