[英]Understanding how git diff & git cherry-pick works
Here is the repro repo: https://github.com/sathishsoundharajan/git-diff这是repro repo: https : //github.com/sathishsoundharajan/git-diff
Steps脚步
git cherry-pick 593da755a9ea90b6f55bcc6d184f249218bf4170
.git cherry-pick 593da755a9ea90b6f55bcc6d184f249218bf4170
。 Cherry-picked without conflicts but the commit_id changed to https://github.com/sathishsoundharajan/git-diff/commit/e58427c82322d6a3ec933741887f5b8312981e11Questions:问题:
1 because history is different so the IDs can't be the same for security/cryptographic reasons. 1 因为历史不同,因此出于安全/加密原因,ID 不能相同。
2 no, related ro #1 ... if you got the same ID, that would mean you found a collision (or you are producing the exact same objects, like what git svn
does)... theoretically possible but.... 2 不,相关的 ro #1 ...如果你有相同的 ID,那意味着你发现了碰撞(或者你正在产生完全相同的对象,就像
git svn
所做的那样)......理论上是可能的,但是......
3 because in PR/MR, you see differences not between the tips of the two branches but since the feature branch is started , say (what you get if you try git diff
with ...
instead of ..
). 3 因为在 PR/MR 中,您看到的不是两个分支的提示之间的差异,而是因为功能分支已启动,所以说(如果您尝试使用
...
而不是..
git diff
会得到什么)。 If you saw the differences between the 2 tlps of the branches, code review would be hell because you would see changes from the MR/PR itself plus the changes introduced in the target branch since the MR/PR branch was started (not to name that the changes will change over time as more stuff is merged unto the target branch).如果您看到分支的 2 个 tlps 之间的差异,代码审查将是地狱,因为您会看到 MR/PR 本身的更改以及自 MR/PR 分支启动以来在目标分支中引入的更改(不要命名那个随着更多内容合并到目标分支,更改将随着时间的推移而发生变化)。 Who would want to work like that?
谁愿意这样工作?
4 like the diff betwern the 2 branch tips? 4 喜欢 2 个分支提示之间的差异吗? Try with
..
instead of ...
.尝试使用
..
而不是...
。 Now, on github?现在,在 github 上? They might provide the option if they considered it necessay but I don't think you will find a lot of customers would be interested.... and then it's about them, not about git.
如果他们认为这necessay,但我不认为你会发现很多客户有兴趣....然后它是关于他们,不是混帐他们可能提供的选项。
5 what do you mean? 5 你是什么意思?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.