CommitFilter / CommitSortStrategies Understanding
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start with the CommitFilter, CommitSortStrategies, and QueryBy entry points referenced in the issue, then compare their behavior with the listed git command examples. Document whether each proposed equivalence is correct and specify the ordering semantics of CommitSortStrategies.None; completion means the questions have an authoritative explanation.
Written by the indexing model from the issue text.
Description
I am trying to understand what "CommitSortStrategies" is actually doing to the commit collections that I am getting back and am just looking for clarification if this is correct.
Git, by default (cmd line app), are shown in reverse chronological order, so:
- git (default sort) == CommitFilter/SortBy of (Undefined)
- git --reverse != CommitFilter/SortBy of Reverse
- git --reverse == CommitFilter/SortBy of Reverse | Time
- git --topo-order == CommitFilter/SortBy of Topological
- git --reverse --topo-order == CommitFilter/SortBy of Reverse | Topological
- git --______ ?= CommitFilter/SortBy of None
- CommitFilter/SortBy of None != CommitFilter/SortBy of (Undefined)
Is that list correct/complete?
(FYI: I have a multi-million object repo with millions of refs and have reverted to shelling to git to get the commit lists between cross-merge branches as I can not get a direct match between libgit2's ls-trees and gits, my head hurts....)
BTW: What order does CommitSortStrategies.None follow? Based on ref creation order on the file-system, maybe?
A sample for a future reader:
# Note: Piping to head as you can not use -n <number>, --max-count=<number> as that is applied before commit ordering
git log HEAD..master --format="%ci %h %s" --reverse | head -10
So based upon the equivalence list above, in libgit2sharp this becomes:
var filter = new CommitFilter {
SortBy = CommitSortStrategies.Reverse | CommitSortStrategies.Time,
Since = master, // determined by a prior repo.Lookup<Tree>
Until = head, // determined by a prior repo.Lookup<Tree>
};
repo.Commits.QueryBy(filter).Take(10);
- 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 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100