libgit2 / libgit2/libgit2sharp

Repository.Commits.QueryBy is missing changes

Aperta
#1,752 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Reproduction steps

This seems to have been brought up a couple of times already (a quick search showed #1401, #1591, https://github.com/libgit2/libgit2sharp/pull/963#issuecomment-355674649).

This is pretty weird: QueryBy returns 0 LogEntries, while going through all commits and diffing to the previous one shows the same changes/additions/renames as e.g. the SourceTree or Fork UI for the exact same path as for the QueryBy call.

Note that it only does that for some files, most files work fine. I haven't found a common pattern so far (e.g. specific characters, or only merges, or ...) but it looks like QueryBy is omitting merges and that might cause problems.

image
(commits in reverse order)

Expected behavior

QueryBy should return all changes to the file (as outlined in #963 where it was originally added).

Actual behavior

QueryBy returns 0 LogEntries.

Version of LibGit2Sharp (release number or SHA1)

git2-106a5f2

Operating system(s) tested; .NET runtime tested

Win 10, .NET 4.6

EDIT: Maybe I'm understanding the code wrong, but taking a quick peek at https://github.com/libgit2/libgit2sharp/blob/master/LibGit2Sharp/Core/FileHistory.cs#L137, I think QueryBy in fact ignores all commits that have more than 1 parent (e.g. all merges).

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.

Direzione di ricerca

Inizia riproducendo le LogEntries mancanti per il percorso interessato su Windows/.NET 4.6, confrontando QueryBy con l’approccio diff su tutti i commit descritto nell’issue. Leggi LibGit2Sharp/Core/FileHistory.cs intorno alla riga 137, concentrandoti su come vengono gestiti i commit con più genitori. Il lavoro è completo quando QueryBy restituisce tutte le modifiche per il file interessato, comprese quelle relative ai merge.

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

Valutazione

Stack tecnologico
csharp, git
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.