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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Introducing Git protocol version 2

547 点作者 robmaceachern大约 7 年前

17 条评论

oneeyedpigeon大约 7 年前
The current (and pretty much only, ever, despite Linus having been the creator) maintainer of git is a google employee [1], in case anyone else was wondering.<p>[1] <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Junio_Hamano" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Junio_Hamano</a>
评论 #17103533 未加载
评论 #17104871 未加载
评论 #17103481 未加载
评论 #17105505 未加载
评论 #17103604 未加载
评论 #17104576 未加载
simias大约 7 年前
Let that be a reminder to all the coders out there: if you ever design a protocol or file format to communicate between machines always remember to add a version field or some other way to allow for updates and revisions later without breaking everything. Having a way to specify extensions in a backward-compatible way is nice too.
评论 #17103723 未加载
评论 #17106727 未加载
评论 #17104442 未加载
avar大约 7 年前
The specification of the v2 protocol is here: <a href="https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;master&#x2F;Documentation&#x2F;technical&#x2F;protocol-v2.txt" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;master&#x2F;Documentation&#x2F;technic...</a><p>One of the more exciting things is that it can now be extended to arbitrary new over-the-wire commands. So e.g. &quot;git grep&quot; could be made to execute over the network if that&#x27;s more efficient in some cases.<p>This will also allow for making things that now use side-transports part of the protocol itself if it made sense. E.g. the custom commands LFS and git-annex implement, and even more advanced things like shipping things like the new commit graph already generated from the server to the client.
评论 #17107115 未加载
Someone1234大约 7 年前
Too bad they didn&#x27;t make Git LFS part of Version 2[0]. Most vendors[2] support LFS already but because it isn&#x27;t required, some still lack it and its support cannot be assumed.<p>[0] <a href="https:&#x2F;&#x2F;git-lfs.github.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;git-lfs.github.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;git-lfs&#x2F;git-lfs&#x2F;wiki&#x2F;Implementations" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;git-lfs&#x2F;git-lfs&#x2F;wiki&#x2F;Implementations</a>
评论 #17103704 未加载
评论 #17107138 未加载
评论 #17106230 未加载
评论 #17104512 未加载
评论 #17103658 未加载
评论 #17103623 未加载
lsiebert大约 7 年前
I&#x27;m a very (very) minor contributor to git.<p>If you are at all interested in hacking on Git, it&#x27;s not that difficult. Knowing C and portable shell scripting for writing tests are the big things.<p>One sticking point, you need to submit patches to the mailing list, you can&#x27;t just do a github pull request.<p>See <a href="https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;master&#x2F;Documentation&#x2F;SubmittingPatches" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;master&#x2F;Documentation&#x2F;Submitt...</a><p>I still see github pull requests rather frequently, even though they have never been allowed. All discussion AND patches go through the mailing list, much like the linux kernel.
评论 #17107313 未加载
newscracker大约 7 年前
Sometime in the far future, someone will write an interesting story about how a double null byte came into existence in the git request protocol, and it will be amusing and interesting to look back. As the saying goes, hindsight is always 20&#x2F;20. I&#x27;m glad that they found ways to maintain backward compatibility, at only a minor cost to understanding things.
Confiks大约 7 年前
It&#x27;s quite a comedy that this feature has not been implemented for at least 6 years, solely because the raw git:&#x2F;&#x2F; protocol&#x27;s parameter handling was severely broken, and feature detection by disconnecting and retrying [1] was ultimately deemed far too dirty.<p>[1] <a href="https:&#x2F;&#x2F;public-inbox.org&#x2F;git&#x2F;CAJo=hJtZ_8H6+kXPpZcRCbJi3LPuuF7M1U8YsjAp-iWvut9oMw@mail.gmail.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;public-inbox.org&#x2F;git&#x2F;CAJo=hJtZ_8H6+kXPpZcRCbJi3LPuuF...</a>
cpburns2009大约 7 年前
Wait, why was this posted by Google? I thought Git was made by Linus Torvalds.
评论 #17103517 未加载
评论 #17103492 未加载
评论 #17104679 未加载
评论 #17103555 未加载
rwmj大约 7 年前
Is there a git protocol variant that allows the client to avoid downloading objects that it already has stored locally in another repository or cache?<p>For example: I have the Linux kernel already cloned in some directory. I clone a second repo which has the Linux kernel as a submodule. Can I clone the second repo straightforwardly without having to download Linux a second time? (Well yes, but only by manual intervention before doing the git submodule update - it&#x27;d be nice if objects could be shared in a cache across also repos somehow).
评论 #17104709 未加载
评论 #17104893 未加载
评论 #17107083 未加载
评论 #17105687 未加载
评论 #17104701 未加载
评论 #17105033 未加载
buckminster大约 7 年前
AIUI, the git ssh protocol is just the git protocol tunnelled through ssh. So why do they need different mechanisms for signalling V2?
评论 #17103490 未加载
评论 #17103521 未加载
Boulth大约 7 年前
&gt; Server-side filtering of references<p>I wonder if this will be somehow exposed by git daemon. It could be used for easy per ref access controls.<p>For example Git Switch [0] that uses Macaroons had to clone the repository to implement per ref ACL.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;rescrv&#x2F;gitswitch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rescrv&#x2F;gitswitch</a>
ksec大约 7 年前
I thought google uses hg, have they switched over to git as well?
评论 #17103353 未加载
hartator大约 7 年前
Is Git a Google project now?
评论 #17104944 未加载
评论 #17104991 未加载
Ericson2314大约 7 年前
This is disgusting. So little forsight in the past... At least the outcome of quite useful.
评论 #17104036 未加载
评论 #17103386 未加载
s2g大约 7 年前
oh neat, and it&#x27;s on a google blog.<p>That&#x27;s great. Another subtle reminder that this ad company has way too much control.
GauntletWizard大约 7 年前
Interesting that they took to the Google blog to announce this; is there a corresponding LKML post?
评论 #17103421 未加载
评论 #17103429 未加载
评论 #17104697 未加载
评论 #17108022 未加载
gpvos大约 7 年前
Git didn&#x27;t have a proper version number or extensibility field in its protocol? That&#x27;s quite a bit of hubris.
评论 #17103388 未加载