libgit2 / libgit2/libgit2sharp

Pushing new branches does not set up tracking branch completely

オープン
#514 コメント 9 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Up for grabs
主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

When you push a local branch that does not exist on the remote (using the refspec overload), libgit2sharp automatically creates a tracking branch, but it does not set up the config for the local branch

i.e. the following config entries are missing:

branch.(branch_name).remote
branch.(branch_name).merge

Currently, I push a new branch like as follows:

string refspec = string.Format("{0}:{1}",
    currentBranch.CanonicalName, currentBranch.CanonicalName);
repo.Network.Push(remote, refspec, handler, credentials);
repo.Branches.Update(repo.Head, delegate(BranchUpdater updater)
{
    updater.Remote = remote.Name;
    updater.UpstreamBranch = repo.Head.CanonicalName;
});

I feel like this should be simplified. Either by doing the BranchUpdater stuff in Push(), or by extending the Push(Branch, ...) overload to let it accept non-tracking branches and do the whole process.

I also did not find a test fixture covering that feature, so the intended behaviour should at least be specified.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に示されている Push のオーバーロードと BranchUpdater の使用箇所を読み、次に既存の push テストフィクスチャを確認してください。issue では、この動作をカバーするものがないと述べられています。対応完了の条件は、サポート対象の新しいブランチへの push パスで branch.remote と branch.merge の設定が確立され、意図した動作を明示するテストがあることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。