英文:
Does bundler search all branches of a repo for the commit when using `ref` option for Gemfile source?
问题
Bundler 在 Gemfile 源使用 ref
选项时是否在存储库的所有分支中搜索提交?
例如,如果提交哈希 a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56
在 main
或 master
分支上不存在,那么如果它存在于其他分支(如 feature1
)上(并且不是最新提交,因此 branch:
选项不足以满足要求),Bundler 是否仍然会找到该提交?
英文:
Does bundler search within all branches of a repo for the commit when using ref
option for Gemfile source?
gem 'rails', github: 'rails', ref: 'a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56'
As an example, if the commit hash a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56
does not exist on the main
or master
branch, will bundler still find the commit if it exists on another branch such as feature1
(and is not the latest commit so the branch:
option will not suffice)?
答案1
得分: 0
如果提交哈希值a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56不存在于主分支或主分支上,那么Bundler是否仍然能够找到该提交,即使它存在于另一个分支,例如feature1(并且不是最新的提交,所以branch选项不足以满足)?
是的。
Bundler将能够获取指定的引用,即使它没有合并到master
分支。这对Bundler来说很容易,因为Git/GitHub的性质使您可以通过引用选择任何提交,而不受该提交合并到哪些分支的影响。
根据Bundler的源代码:
ref
选项优于branch
选项branch
选项优于tag
选项
branch
和tag
都是用于引用的符号名称,仅供人类方便使用。
英文:
> if the commit hash a9752dcfd15bcddfe7b6f7126f3a6e0ba5927c56 does not exist on the main or master branch, will bundler still find the commit if it exists on another branch such as feature1 (and is not the latest commit so the branch: option will not suffice)?
Yes.
Bundler will be able to fetch the specified ref even if doesn't merged to master
branch. It is easy to do for Bundler because of nature of Git/GitHub: you could pick any commit by reference independent of the branches that commit merged to.
According to the source code of Bundler:
ref
option has an advantage overbranch
optionbranch
option has an advantage overtag
option
Both branch
and tag
are symbolic names for refs and used just for human convenient.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论