libgit2 / libgit2/libgit2sharp
CommitLog order does not reflect order of commits.
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 3.5k
- Fork
- 925
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi!
I am currently working on an E2E test which involves creating many commits, I am running into some issues however.
The repository's commit log order is different compared to the order of commits I have made.
Reproduction steps
public LibGitRepositoryBuilder WithManyCommits(int numberOfCommits, string commitMessage)
{
for (int i = 0; i < numberOfCommits; i++)
{
// Create & stage file.
var filePath = Path.Combine(_repoPath, $"{Guid.NewGuid()}.txt");
File.Create(filePath).Dispose();
var relativeFilePathToRoot = Path.GetRelativePath(_repository.Info.WorkingDirectory, filePath);
Commands.Stage(_repository, relativeFilePathToRoot);
_repository.Commit($"{commitMessage}-{i}", new Signature("bot", "bot@noreply.com", DateTimeOffset.UtcNow), new Signature("bot", "bot@noreply.com", DateTimeOffset.UtcNow));
}
return this;
}
var repo = new LibGitRepositoryBuilder(path)
.WithManyCommits(100, "Hello world")
.Build();
Expected behavior
- "Hello world-99"
- "Hello world-98"
- "Hello world-97"
- ....
Actual behavior
Version of LibGit2Sharp (release number or SHA1)
0.30.0
Operating system(s) tested; .NET runtime tested
OS
Edition Windows 11 Pro for Workstations
Version 23H2
Installed on 22/02/2024
OS build 22631.3593
Experience Windows Feature Experience Pack 1000.22700.1003.0
.NET
.NET 8.0
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề về thứ tự với ví dụ LibGitRepositoryBuilder.WithManyCommits được nêu và kiểm tra cách nhật ký commit của repository được liệt kê. Issue không nêu tên tệp nguồn hoặc bài kiểm thử nào, vì vậy trước tiên hãy tìm phần triển khai CommitLog và các bài kiểm thử nhật ký hiện có. Hoàn tất khi các commit được tạo tuần tự xuất hiện theo đúng kỳ vọng, với commit mới nhất ở đầu tiên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, git
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100