libgit2 / libgit2/libgit2sharp
View Incoming Commits from a Pre-Receive Hook
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 3.5k
- Forks
- 925
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I have developed a pre-receive hook using C#/.NET and used libgit2sharp to retrieve the commits that are being pushed from the client. When I access the Repository.Commits, I only see the old commits not the ones that are being pushed.
I tried using a bash script to implement the hook and execute git rev-list $rev_old..$rev_new and it works and I can see the commits.
So, I'm wondering why does the bash script work and the C#/.NET executable does not given that both executables are executing on the same working directory that Git assigns to the hook.
P.S. I'm using BitBucket Server on-premise deployment - it shouldn't matter I think because the hook works at the Git level not BitBucket
Reproduction steps
- Create a .NET 6.0 Console application and add a reference to
libgit2sharp. - Write code to obtain the commits between the old ref and the new ref as provided by Git.
- Build and configure the hook on the Git repository directory.
- Use a Git client to push commits to the server.
Expected behavior
The commits coming from the client should be seen when the Repository.Commits is enumerated.
Actual behavior
Only the commits before the push are returned not the incoming commits.
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Ubuntu 18.04 and .NET 6.0
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le pre-receive hook avec libgit2sharp 0.26.2 sur Ubuntu 18.04 et .NET 6.0, en comparant Repository.Commits avec les anciennes et nouvelles valeurs de ref fournies par Git. Lisez les arguments de ref du hook et le comportement de Repository.Commits ; le travail est considéré comme terminé lorsque les commits entrants sont observables ou que la limitation et l’utilisation correcte sont documentées.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp, git
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100