MergeOptions: TargetLimit (merge.renameLimit) is being ignored during merge operation
還沒有人認領這個 Issue。
評估
研究方向
先追蹤 repo.Merge 中的 MergeOptions.TargetLimit 值在合併操作中的傳遞過程,並將其與 git merge 命令從 .gitconfig 讀取 merge.renameLimit 的方式進行比較。使用提供的分支配置重現 Foo.cs-to-Bar.cs 情境,並驗證當 TargetLimit 為 7000 時合併能夠在沒有衝突的情況下完成。
由索引模型根據 Issue 內容生成。
描述
Reproduction steps
The sourceBranch and targetBranch has a commonAncestorCommit with an existing file Foo.cs. A lot of (let's say: 3000) other files exist too.
The sourceBranch contains one single extra commit on top of commonAncestorCommit with a modification inside a file Foo.cs.
The targetBranch (current branch) contains one single extra commit on top of commonAncestorCommit in which the file Foo.cs has been renamed to Bar.cs, and a lot of (let's say: 2000) other files have also been renamed.
The following merge from sourceBranch to targetBranch ignores TargetLimit (merge.renameLimit), and causes an unnecessary conflict:
using (var repo = new Repository(...))
{
Commands.Checkout(repo, targetBranch);
var mergeOptions = new MergeOptions { TargetLimit = 7000 };
repo.Merge(sourceBranch, mergerSignature, mergeOptions)
}
Expected behavior
A successful merge without conflict.
Actual behavior
We are staying in the ongoing merge operation, and the git status reports conflict for the file Foo.cs stating that it has been "deleted by us".
Note that the plain git merge command can merge this without conflicts if the merge.renameLimit setting is set to 7000 in the .gitconfig file.
Version of LibGit2Sharp (release number or SHA1)
LibGit2Sharp 0.26.2
LibGit2Sharp 0.27.0-preview-0182
Operating system(s) tested; .NET runtime tested
Windows 10 Enterprise N
.NET 6.0.8
- 主要語言
- C#
- 星號
- 3.5k
- 分支
- 925
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
libgit2/libgit2sharp 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 52/100
libgit2/libgit2sharp#2193 · 2 則留言 ·
-
難度 4/5 3-5 天 新手友好度 38/100
libgit2/libgit2sharp#2192 · 1 則留言 ·
-
Website is down 未關閉
難度 4/5 3-5 天 新手友好度 20/100
libgit2/libgit2sharp#2191 · 2 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 68/100
libgit2/libgit2sharp#2189 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 35/100
libgit2/libgit2sharp#2187 · 2 則留言 ·
查看 libgit2/libgit2sharp 的全部 Issue
相似的 Issue
-
:watch: Not Triaged dotnet-fsharp/svc
難度 1/5 1 小時以內 新手友好度 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
難度 2/5 1-3 小時 新手友好度 76/100
Azure/azure-sdk-for-net#63292 · 3 則留言 · 1 個 reaction ·
-
Issue-Enhancement Needs-Triage
難度 1/5 1 小時以內 新手友好度 86/100
PowerShell/PowerShell#28061 · 2 個 reaction ·
-
dependencies needs-team-triage server-Azure.Mcp
難度 2/5 1-3 小時 新手友好度 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
難度 1/5 1 小時以內 新手友好度 88/100
dotnet/AspNetCore.Docs#37729 ·