libgit2 / libgit2/pygit2

repo.status() appears to be broken?

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

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

主要言語
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?

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

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

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