Support: How can I access the commit history of a bare git repo from pygit2 (article linked)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 408
- Merge medio
- 2 d 57 min
- PR fusionados (30 d)
- 7
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza leyendo el artículo enlazado sobre dotfiles y la documentación de pygit2 sobre bare repositories, work trees, status, references y commits; compara esos puntos de entrada con el alias git-dir/work-tree mostrado. El issue solo estará resuelto cuando el flujo de trabajo de Python compatible esté documentado claramente, o cuando se indiquen la limitación y una alternativa viable.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- git, python
- Área
- developer-experience, tooling
- Tipo de issue
- Documentación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100