CommitFilter / CommitSortStrategies Understanding

Aperta
#1,145 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Documentazione
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
csharp, git
Ambito
devtools

Direzione di ricerca

Iniziare dagli entry point CommitFilter, CommitSortStrategies e QueryBy citati nell’issue, quindi confrontarne il comportamento con gli esempi di comandi git elencati. Documentare se ogni equivalenza proposta è corretta e specificare la semantica dell’ordinamento di CommitSortStrategies.None; il completamento si considera raggiunto quando le domande hanno una spiegazione autorevole.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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);
Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di libgit2/libgit2sharp

Tutte le issue di libgit2/libgit2sharp

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.