libgit2 / libgit2/libgit2sharp
Last Commit message per treeEntry
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 3.5k
- Forks
- 925
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hi i dont know it is implemented now but i want retrieve treeeObject from repository with last commit message in which commit current file / folder was changed. I trying to solve this for 2 days but didnt find any usefull on forums or on docummentation here. Thanks for help.
Reproduction steps
what i tried
var xxx = tree[path];
// For tree
if (xxx.TargetType == TreeEntryTargetType.Tree)
{
foreach (var item in (Tree)xxx.Target)
{
var CommitMessages = _repository.Commits.QueryBy(item.Path);
string commitMessage = null;
if (CommitMessages != null)
{
commitMessage = CommitMessages.Take(1).Last().Commit.MessageShort;
}
treeObjects.Add(new TreeObject {
Name = item.Name,
Sha = item.Target.Sha,
Type = item.TargetType.ToString(),
Path = item.Path,
CommitMessage = commitMessage
});
}
}
But its very slow and not every time it return InvalidOperationException: Sequence contains no elements and its take too much time ... (17secs till error?)
Expected behavior
To retireive treeEntries with at least commit sha Or better with commit itself
Actual behavior
I can retireve treeEntries and then look for Commits but there is problem it stilll pulling tree in commit and it is so slow,
Version of LibGit2Sharp (release number or SHA1)
commit 8950f498511d9e4cc1756193682ac3bb08581166
Operating system(s) tested; .NET runtime tested
.Net core 3
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
Comienza con el ejemplo de tree-entry y el uso de _repository.Commits.QueryBy(item.Path), y después revisa cómo se representan las entradas de árbol y las consultas de commits en LibGit2Sharp. Compara el último SHA o mensaje de commit solicitado con el comportamiento lento actual y el fallo de una secuencia vacía. Done debe definir una forma fiable y eficiente de asociar cada entrada de archivo o carpeta con su último commit relevante.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, git
- Área
- devtools
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100