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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Rework git core for native submodules

103 点作者 sdqali大约 12 年前

12 条评论

drewcrawford大约 12 年前
I am not a git maintainer, but as someone interested in improving submodules I can try to summarize the thread.<p>Submodules are difficult to use in practice for a wide variety of reasons. There are serious, complex proposals that have made it into git-contrib to build a "better" submodule, but for various reasons these have produced systems that merely make the tradeoffs in a different way that some people prefer.<p>This is not like any of those proposals. His problem is that "git add" "git diff", etc., don't "understand" submodules. It would be as if ls, cd etc. don't "follow" symlinks, so that you had to navigate to the correct directory yourself before you can use standard unix tools.<p>This is a serious problem, but his solution is essentially "we should use hardlinks instead of symlinks". That is, he wants to take the code that understands submodules out of the individual tools, and pop them in the filesystem somewhere where they are "shared" among more of the tools and don't have to exist in any of them.<p>There are many objections to this proposal. The chief one seems to be that this does not seem to directly address any particular problem. I think Ramkumar perceives that the reason git add/diff/rm don't support submodules is as a metaproblem "it is too hard to add submodule support to arbitrary tool". Whereas the git maintainers are saying "It is <i>possible</i> to add submodule support to arbitrary tool." So that's the initial standoff.<p>Another problem is that this requires a filesystem change, and that is essentially the most stable part of git that breaks incompatibility with other versions. If you read Linus's rants, you know that he generally applies an enormous amount of scrutiny to breaking compatibility. And so from his desk, you would need not just one clear benefit, but an overwhelming number of them, to break the contract like this.<p>But what I suspect is the True Rejection here is that this will pan out like all the proposals before it: to be different, but not strictly better, than the current implementation. To return to the POSIX analogy: we have both symlinks and hardlinks, and which one is better depends on what you are doing, there is no "one true link". If you replace all the symlinks with hardlinks, I think you will run into trouble with the hardlinks too.<p>Finally, it is unfortunate that the flamewar is about the monolithic patch rather than about some of the principles that led to the patch. I think Ramkumar has had (at least) two very good insights: that "git add" and friends should understand submodules a lot better than they do, and also that they should have this understanding by way of consuming some API that understands them rather than incorporating separate code for submodules into every tool. These strike me as a concrete improvement over the existing system, and I wish that the energy that leads to huge unusable patches like this could be redirected into usable ones.
评论 #5548083 未加载
niggler大约 12 年前
"This is going nowhere. You're stuck at making the current submodule system work, not answering my questions, diverting conversation, repeatedly asking the same stupid questions, labelling everything that I say "subjective", and refusing to look at the objective counterpart (aka, the code). It's clear to me that no matter how many more emails I write, you're not going to concede.<p>I'm not interested in wasting any more of my time with this nonsense.<p>I give up."<p><a href="http://thread.gmane.org/gmane.comp.version-control.git/220514/" rel="nofollow">http://thread.gmane.org/gmane.comp.version-control.git/22051...</a>
评论 #5550080 未加载
评论 #5547544 未加载
artagnon大约 12 年前
Who's who, for those of you just joining in:<p>- Linus is the original author of Git, and he wrote it in April 2005. He doesn't contribute anymore, and is rarely seen on the Git mailing list these days (except when something like this happens). In number of patches, he's #4, after Junio, Jeff, and Shawn.<p>- Junio is the maintainer of the Git project. He took over maintainership of Git a few months after it was originally built, in July 2005.<p>- Jonathan is a very big contributor at #6. He doesn't focus on any one part of the codebase, and contributes to a wide spectrum.<p>- Jens primarily contributes to submodule.c/ git-submodule.sh, the current submodule implementation. Along with Heiko, he's one of the authorities on the current submodule system.<p>- Ram is a small contributor. He started out in Jan 2010 with two GSoC projects: one in 2010, and another in 2011 (neither were in submodules).
qznc大约 12 年前
He wants to unify submodules and subtrees? Sounds fishy to me, since these are for very completely different use cases.<p>Submodules are for tying project parts together, where you have control over all of them. For example, the clang compiler frontent could submodule the LLVM backend. Both are under the LLVM project, so people usually work on both of them at the same time. They should not be in the same repo, since LLVM also has other users unrelated to clang.<p>Subtrees are for integrating external projects, which are not really under your control, but you probably want to follow upstream developments. Since a subtree includes all the repo data, you can cleanly check out, even if the external origin repository vanishes.
评论 #5548275 未加载
评论 #5547978 未加载
评论 #5548981 未加载
Tobu大约 12 年前
I've started the thread on Linus's first reply, and the guy is completely unconvincing. He was after a quick feature improvement (I don't really know what but Linus seemed to) and implemented it, but he gave little thought to the overall design (either his or Git's).<p>Big meh, and I'm normally interested in the evolution of Git.
评论 #5547565 未加载
评论 #5547552 未加载
评论 #5549077 未加载
评论 #5550092 未加载
alexchamberlain大约 12 年前
I would like to applaud this guy; he has got insightful and polite answers from Linus.
评论 #5548020 未加载
drtse4大约 12 年前
This thread is a mess... and i'm not sure statements like this one "'git add' should not go past submodule boundaries. I should not be able to 'git add clayoven/' or 'git add clayoven/LICENSE'" are a good start. Gives a simplified description of what he want to do without going too in-depth about why that path was chosen and starts coding right away.
评论 #5547578 未加载
plorkyeran大约 12 年前
Mostly unrelated to the topic, but I'm always amused by things like "teach ce_compare_gitlink() about OBJ_LINK". I've never seen any other project that anthropomorphizes the code like that, and I sort of like how it makes the resulting changelog read.
评论 #5549593 未加载
stormbrew大约 12 年前
So, I'm curious. In response to Linus' comment that "... .gitmodules was always a bit of a hack, but it's a <i>working</i> hack ...", does anyone who's actually used them really feel that they are indeed a 'working' hack? I find that whenever I interact with a git repo with submodules I spend an inordinate amount of time wrangling them to do things they clearly weren't meant to do. I find that most people I talk to about them have experienced the same. And then I go and do something like try to use bisect in concert with them and I basically want to shoot my computer.<p>Am I missing something?
richardwhiuk大约 12 年前
I'd really like something like this to happen, but I agree that this set of patches isn't likely to get included. Submodules are my biggest gripe with git usage, and what persuades me not to suggest people roll git out more widely. I've seen various strategies to avoid submodules (build scripts that clone sub repos instead is one example alternative) but it'd be much nicer if it there was a One True Way which worked properly.
lnanek2大约 12 年前
Sure would be nice. Sometimes I'm working on projects and get sent repos to work on with all the deps missing, because people just cloned the deps into subdirectories and git ignored them or something. Would be much better if they had a .git in every folder like Subversion does nowadays instead of trying to have a special root that includes and ignores certain children.
comex大约 12 年前
Just to comment on one of the issues in the thread: not everyone uses a command line editor or even an editor which can be easily invoked from the command line (though I do), so requiring a special command, "git edit-link", to edit some inherently textual data that seems to work perfectly well being stored as a normal text file in the repository, is a little gross.