libgit2 / libgit2/libgit2sharp

Create a Pull Request (git pull) by adding one or more reviewers option?

Open
#1,991 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I am using .NET 5.0 Using libgit2sharp 0.26.0, I've written code to clone , create a new branch, change some files, commit and push branch to bitbucket.
Now I need to create a pull-request and add a reviewer to it. However, my Google searches don't turn up any relevant info.
Does libgit2sharp support creating PRs by adding reviewer? Any help

using (var repo = new Repository(LocalRepoUrl))
{
Signature Signature = new Signature(Username, Email,
new DateTimeOffset(DateTime.Now.Year,
DateTime.Now.Month, DateTime.Now.Day,
DateTime.Now.Hour,
DateTime.Now.Minute, DateTime.Now.Second,
TimeSpan.FromHours(2)));
FetchOptions fetchOptions = new FetchOptions();
fetchOptions.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials
{
Username = Username,
Password = Password
};

            MergeOptions mergeOptions = new MergeOptions();
            mergeOptions.IgnoreWhitespaceChange = true;
            mergeOptions.FailOnConflict = true;
            mergeOptions.CommitOnSuccess = true;
            mergeOptions.FastForwardStrategy = FastForwardStrategy.Default;

            PullOptions pullOptions = new PullOptions();
            pullOptions.FetchOptions = fetchOptions;
            pullOptions.MergeOptions = mergeOptions;
            // how to add reviewer
            var mergeResult = Commands.Pull(repo, Signature, pullOptions); // no pull request generated

 Please correct me if I am wrong and suggest me with the correct code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the relationship between Commands.Pull, PullOptions, and the requested pull-request and reviewer workflow described in the issue. Check whether the repository exposes an entry point for that workflow; done should be a clear supported-or-not answer, with any required scope identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.