libgit2 / libgit2/pygit2

how to diff one file in working dir against a Blob?

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

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

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

説明

pygit2 version python3-pygit2-0.23.3-2.fc23.x86_64

I cannot figure out how I can get a diff for only one file.

How do I arrange to have pygit2 return the diff of a Blob against the working dir file?

I looked at calling diff_to_working on a new Index(), but that fails because the new Index() does not
self._repo filled in.

TreeBuilder() seems is unable to help as it requires putting tree objects into the repo to allow
for the folder structure, for example to diff Source/file.py. needs a tree for Source. I clearly
do not want to be writting files into the repo to do a diff.

Did I miss something in API?

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

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

はじめの一歩

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

調査の方向性

まず、issue で言及されている diff_to_working API と Index API、および pygit2 が Blob と作業ディレクトリのファイルをどのように表現するかを確認します。リポジトリのツリーオブジェクトを作成せずにこの比較をサポートする既存の API があるかどうかを判断します。単一の Blob と作業ツリーの diff に対応するパスを特定または指定できれば完了です。

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

評価

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

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

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