repo.status() appears to be broken?
オープン
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
説明
I'm running repo.status().items() in a pre-commit hook using the -a flag (git commit -a -m "Test"), and I get a result that looks like this:
[('config/git_hooks/pre-commit', 256), ('bin/run_flake8', 256)]
If I run git status in that same process, I get:
On branch ops_1331_fix
Your branch is ahead of 'origin/ops_1331_fix' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: bin/run_flake8
modified: config/git_hooks/pre-commit
In other words, pygit2 is reporting those files as not being staged, and git is reporting them as being staged. Why the discrepancy?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、git commit -a を使用しているときの pre-commit hook で repo.status().items() による不一致を再現し、次にその結果を、一覧にある 2 つのファイルについての git status の結果と比較します。pygit2 status API と関連する libgit2 の動作を確認します。ステージされたファイルが status 256 を受け取る理由を説明し、それがバグである場合は不一致を修正できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100