libgit2 / libgit2/libgit2sharp
Question/Feature request: Rebase branch using a Tag as upstream
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 3.5k
- 派生
- 925
- PR 合并指标
- 30 天内没有已合并 PR
描述
This is potentially a feature request, if there is no way of accomplishing this using the current version of LibGit2Sharp
I am trying to use LibGit2Sharp to rebase a feature branch using a Tag as upstream. The initial graph looks like this:
* -- * -- * (featureA)
/
/
*--*--*--*--*--*--*--*--*--*--*--*-- (master)
| | | |
tag1 tag2 tag3 tag4
The idea is to rebase featureA branch on master, but not on the HEAD of master (last commit), but rather on the commit corresponding to tag2.
The end result would be something like this:
* -- * -- * (featureA)
/
/
*--*--*--*--*--*--*--*--*--*--*--*-- (master)
| | | |
tag1 tag2 tag3 tag4
The git syntax for this would be (and it works perfectly):
git rebase ref/tags/tag2 featureA
However, LibGit2Sharp syntax only allows passing in a Branch as argument for the upstream param.
var rebaseOptions = new RebaseOptions {...};
var identity = new Identity(...);
Branch branch = repo.Head;
Tag upstreamTag = repo.Tags[ontoTag];
var rebaseResult = repo.Rebase.Start(
branch,
upstream, // <-- this is where I am struggling to pass in this Tag as upstream
null,
identity,
rebaseOptions);
Is this achievable via LibGit2Sharp?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从报告中所示的 repo.Rebase.Start 以及 RebaseOptions、Branch 和 Tag 类型开始;将 upstream 参数与仓库的标签查找及等效的 git rebase 语法进行比较。完成的标准是确定是否可以接受标签作为 upstream;如果不能,则定义所需的 API 更改及其验证覆盖范围。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, git
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100