libgit2 / libgit2/libgit2sharp
CommitFilter / CommitSortStrategies Understanding
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
I am trying to understand what "CommitSortStrategies" is actually doing to the commit collections that I am getting back and am just looking for clarification if this is correct.
Git, by default (cmd line app), are shown in reverse chronological order, so:
- git (default sort) == CommitFilter/SortBy of (Undefined)
- git --reverse != CommitFilter/SortBy of Reverse
- git --reverse == CommitFilter/SortBy of Reverse | Time
- git --topo-order == CommitFilter/SortBy of Topological
- git --reverse --topo-order == CommitFilter/SortBy of Reverse | Topological
- git --______ ?= CommitFilter/SortBy of None
- CommitFilter/SortBy of None != CommitFilter/SortBy of (Undefined)
Is that list correct/complete?
(FYI: I have a multi-million object repo with millions of refs and have reverted to shelling to git to get the commit lists between cross-merge branches as I can not get a direct match between libgit2's ls-trees and gits, my head hurts....)
BTW: What order does CommitSortStrategies.None follow? Based on ref creation order on the file-system, maybe?
A sample for a future reader:
# Note: Piping to head as you can not use -n <number>, --max-count=<number> as that is applied before commit ordering
git log HEAD..master --format="%ci %h %s" --reverse | head -10
So based upon the equivalence list above, in libgit2sharp this becomes:
var filter = new CommitFilter {
SortBy = CommitSortStrategies.Reverse | CommitSortStrategies.Time,
Since = master, // determined by a prior repo.Lookup<Tree>
Until = head, // determined by a prior repo.Lookup<Tree>
};
repo.Commits.QueryBy(filter).Take(10);
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
Comience con los puntos de entrada CommitFilter, CommitSortStrategies y QueryBy mencionados en el issue y, a continuación, compare su comportamiento con los ejemplos de comandos git indicados. Documente si cada equivalencia propuesta es correcta y especifique la semántica de ordenación de CommitSortStrategies.None; la tarea se considerará completada cuando las preguntas cuenten con una explicación autorizada.
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
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100