libgit2 / libgit2/pygit2

flaky repo.reset() behavior

オープン
#1,059 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

主要言語
Python
スター
1.7k
フォーク
408
平均マージ
2日 57分
マージ済み PR(30日)
7

説明

This issue is about repo.reset() not seeming to work reliably 100% of the time.

I have some CI tests that modify a file in a non-bare repo, commit the change to a branch, and then call repo.reset() with GIT_RESET_HARD to restore to a different commit. After calling reset, to confirm that the reset was successful, the test creates a new Repository object and checks the repository's status using repo.status(). Occasionally (but very rarely), the status check comes back showing the original file still as WT_MODIFIED. A subsequent call to repo.diff() confirms the difference in the file. Is there something pygit2 is or isn't doing that could cause reset() to behave flakily like this? Or is libgit2 the more likely culprit?

This is using pygit2 1.2.0. I can try upgrading, but is there a reason to think this would be fixed in a newer version (e.g. a known issue that was fixed)? I haven't found anything like this in pygit2 or libgit2's issue tracker or release notes.

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

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

はじめの一歩

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

調査の方向性

まず、pygit2 1.2.0 で報告された CI シーケンスを再現します。非 bare リポジトリ内のファイルを変更してコミットし、GIT_RESET_HARD を指定して repo.reset() を呼び出し、その後新しい Repository を作成して repo.status() と repo.diff() を比較します。断続的に発生する WT_MODIFIED の結果が pygit2 と libgit2 のどちらに起因するかを特定し、原因または確認済みの修正方針を文書化できれば完了です。

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

評価

技術スタック
git, python
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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