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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

What Happens on Gitlab When You do Git push (2022)

11 点作者 nanmu42大约 1 年前

3 条评论

captn3m0大约 1 年前
&gt; Everyone’s username is git. How does the server distinguish who is who?<p>I used to run a small gitolite&#x2F;redmine installation for a few years. I found its solution to this problem very &quot;unix&quot;-y[0] - Just manage the `authorized_users` file to set the `command=` for each user individually. The file looks like:<p><pre><code> command=&quot;[path]&#x2F;gitolite-shell sitaram&quot;,[more options] ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA18S2t... </code></pre> The gitolite-shell script gets the `$SSH_ORIGINAL_COMMAND` from sshd, and uses that to pick the repo name&#x2F;path. Then it uses the $ARGV to get the actual user. It can then decide on access rules.<p>For branch&#x2F;tag restrictions, it uses git hooks that are setup at repo creation.<p>[0]: <a href="https:&#x2F;&#x2F;gitolite.com&#x2F;gitolite&#x2F;glssh.html" rel="nofollow">https:&#x2F;&#x2F;gitolite.com&#x2F;gitolite&#x2F;glssh.html</a>
zdw大约 1 年前
It&#x27;s also interesting to see how this compares with Gerrit, which uses JGit as the git protocol frontend and stores everything, including all metadata about the code review process and permissions systems, <i>within git repos using a format called NoteDb</i>:<p><a href="https:&#x2F;&#x2F;gerrit-review.googlesource.com&#x2F;Documentation&#x2F;dev-design.html#_notedb" rel="nofollow">https:&#x2F;&#x2F;gerrit-review.googlesource.com&#x2F;Documentation&#x2F;dev-des...</a><p>While it does use separate file-based databases, these are generally only to speed up operations and are not a source of truth.
mdaniel大约 1 年前
good stuff, thank you!<p>I was hoping it was going to get into this wizardry, which I use a great deal: <a href="https:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;user&#x2F;project&#x2F;push_options.html#push-options-for-gitlab-cicd" rel="nofollow">https:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;user&#x2F;project&#x2F;push_options.html#pu...</a><p><pre><code> git push -o ci.variable=CI_TRACE_DEBUG=1 -o merge_request.create origin HEAD </code></pre> although I&#x27;ll be straight, there is waaaaaaaay too much ruby magick going on for my tastes so I tend not to try and be a hero with the variables if it&#x27;s more complicated than just &quot;-o ci.skip&quot; or that trace debug one. Once upon a time I did some spelunking around in their abysmal rails codebase trying to find out, what, exactly syntax I can use and that&#x27;s how I came to the &quot;don&#x27;t be a hero&quot; stance because it was super opaque <i>(yeah, yeah, I know: MRs welcome)</i>