libgit2 / libgit2/libgit2sharp
Add branch querying/filtering feature
Open
Nobody has claimed this yet.
FeatReq
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
The git-branch doc states
With --contains, shows only the branches that contain the named commit (in other
words, the branches whose tip commits are descendants of the named commit).
With --merged, only branches merged into the named commit (i.e. the branches whose
tip commits are reachable from the named commit) will be listed.
With --no-merged only branches not merged into the named commit will be listed.
If the <commit> argument is missing it defaults to HEAD (i.e. the tip of the
current branch).
A potential API design might rely on the following
- Add a
QueryBy()method to theBranchCollectionin a similar way to theCommitCollection.QueryBy()method. - Rename the current
Filtertype toCommitFilter, in order to allow the creation of aBranchFIlter
Binding the following method might also be helpful. Related libgit2 tests can be found here.
/**
* Find a merge base between two commits
*
* @param out the OID of a merge base between 'one' and 'two'
* @param repo the repository where the commits exist
* @param one one of the commits
* @param two the other commit
*/
GIT_EXTERN(int) git_merge_base(
git_oid *out,
git_repository *repo,
git_oid *one,
git_oid *two);
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.
Research direction
Start with BranchCollection and compare its proposed QueryBy() API with CommitCollection.QueryBy(). Review the current Filter type before considering the proposed rename, then inspect libgit2's revwalk/mergebase.c tests and the git_merge_base binding. Done means the branch contains/merged/not-merged queries and related merge-base API are defined with matching tests and a settled API design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100