libgit2 / libgit2/pygit2

Support: How can I access the commit history of a bare git repo from pygit2 (article linked)

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

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

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

説明

Hi libgit2,

I'm fairly new to coding so forgive me if this is a bit of stupid question. I'm working on a script that helps automate the adding and commit of a large list of files to a bare git repo (following the article below). When I try to access the status or history of the bare git repository from bash, the below command and aliasing works fine.

I understand pygit2 has no knowledge of the alias, but I have been trying for days to find the commands for git dir and --work-tree... to get me the same results in the api. There are a few in the api but nothing seems to let me easily check out branches, see their status, add files since the repository is bare? Can anyone provide some clarity on if this workflow is possible form a python git api. GitPython seems to have the same issues.. it could just be me or ?

This is what I'm trying to do, but from python:
https://harfangk.github.io/2016/09/18/manage-dotfiles-with-a-git-bare-repository.html

This is the bash alias that makes working and adding files to the bare git repostory possible, as well as git status etc:
echo 'alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME"' >> $HOME/.zshrc

How do I create this from pygit2 OR gitpython? I need to be able to check status, add, commit, remove from branch a bunch of files and I would like to do it within my python program.

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

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

はじめの一歩

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

調査の方向性

まず、リンク先の dotfiles に関する記事と、bare repositories、work trees、status、references、commits についての pygit2 ドキュメントを読みます。これらのエントリーポイントを、示されている git-dir/work-tree エイリアスと比較します。サポートされている Python ワークフローが明確に文書化されるか、制限と実行可能な代替手段が示された場合にのみ、issue は解決されたものとします。

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

評価

技術スタック
git, python
領域
developer-experience, tooling
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

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

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