Commands.Move is different from git mv
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at the Commands.Move entry point and reproduce the supplied oldPath/newPath case, comparing its resulting git log with the command-line git mv behavior. Done means the behavioral difference is explained and the issue has a confirmed fix or documented expected behavior.
Written by the indexing model from the issue text.
Description
If I use git mv from the command line, I do not lose my history. It is a rename in the history.
If I use Commands.Move it looks in the git log like a file delete and a file create, therefore losing my history. The file is renamed in the file system, but git didn't see the rename.
I'm using libgit2sharp version 0.31.0 with VS 2022 building with .NET 8 and C# version 13 on Windows 11.
My code looks like:
try
{
using (var repo = new Repository(repoRoot))
{
// Moves the file. Path must be in Posix format (using '/' as path separator)
Commands.Move(repo, oldPath, newPath);
ok = true;
}
}
catch (Exception ex)
{
Error = "Git Move exception: " + ex.Message;
}
Am I doing something wrong? I convert the Windows path format to Posix format before using them.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from libgit2/libgit2sharp
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
libgit2/libgit2sharp#2193 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
libgit2/libgit2sharp#2192 · 1 comment ·
-
Website is down Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
libgit2/libgit2sharp#2191 · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
libgit2/libgit2sharp#2189 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
libgit2/libgit2sharp#2187 · 2 comments ·
All issues in libgit2/libgit2sharp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nightscout/nocturne#1379 ·
-
priority-0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100