libgit2 / libgit2/pygit2

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

Ouverte
#971 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

support
Langage dominant
Python
Étoiles
1.7k
Forks
408
Merge moyen
2 j 57 min
PR mergées (30 j)
7

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par lire l’article lié sur les dotfiles ainsi que la documentation de pygit2 concernant les bare repositories, les work trees, status, references et commits ; comparez ces points d’entrée avec l’alias git-dir/work-tree présenté. L’issue n’est résolue que lorsque le workflow Python pris en charge est documenté clairement, ou que la limitation et une alternative viable sont indiquées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, python
Domaine
developer-experience, tooling
Type d'issue
Documentation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.