checking to see if diffFile is a submodule.
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
説明
Is there a way to check to see if a diffFile is a submodule?
The repo that I'm getting my diff deltas from is bare so there's no working directory for Repository.lookup_submodule(path) or Repository.listall_submodules() to work with.
The main issue is when I try to get an added file via something like:
new_file = git_repo[delta.new_file.id]
I get the following key error.
Traceback (most recent call last):
File "/Users/user/project/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/Users/user/project/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/user/project/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/user/project/venv/lib/python3.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/user/project/venv/lib/python3.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/Users/user/project/repos/views.py", line 105, in get
new_file = git_repo[delta.new_file.id]
File "/Users/user/project/venv/lib/python3.7/site-packages/pygit2/repository.py", line 121, in __getitem__
raise KeyError(key)
KeyError: ffeef8955335d0ec95f23c2fd75821672cf14bb9
If it's a submodule I don't need the contents. I just need to know that it's a submodule. Is there a general way to do this?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、delta.new_file.id の周辺の処理と、Repository.lookup_submodule(path) および Repository.listall_submodules() API を、特に bare repositories について読みます。内容を読み込まずに diff エントリがサブモジュールを識別する方法を確認します。リポジトリをインデックス化する前にサブモジュールのエントリを区別する信頼できる方法が文書化または公開されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100