The Filter API contains singleton Entry-points which are agnostic to `FilterMode`, does having `Clean` and `Smudge` entry-points make sense?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- csharp, git
- Ambito
- backend-api-design, tooling
Direzione di ricerca
Inizia esaminando la Filter API esposta e i relativi test, che l’issue identifica come interessati dalle modifiche proposte alla firma. Esamina quindi come vengono gestite le macro clean e smudge di .gitattributes; per considerare il lavoro completato sono necessari un design dell’API concordato, i dipendenti aggiornati e test superati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Today the Filter object (the API we expose to lib consumers) contains the following entry-points:
virtual void Initialize()virtual void Complete(string path, string root, Stream output)virtual void Create(string path, string root, FilterMode)virtual void Clean(string path, string root, Stream input, Stream output)virtual void Smudge(string path, string root, Stream input, Stream output)
This is very uneven and, to my OCD, a fairly inconsistent API. I'm responsible and I'd like to change it, however some have already taken a dependency. In the spirit of #1103 I suggest changing the API to the following.
virtual void Initialize()virtual void Complete(string root, string path, Stream output, FilterMode mode)virtual void Create(string root, string path, FilterMode mode)virtual void Apply(string root, string path, Stream input, Stream output, FilterMode mode)
I believe this is a simplified API which presents a consistent set of entry-points, and leaves the mode management up to the implementation of Filter. I'll happily make the changes and update the associated tests.
As a side note, I had a side-band discussion with @ethomson about how to handle the .gitattributes macros (example: [filter "lfs"] \n clean = git lfs clean %f \n smudge = git lfs smudge %f). While there are normal situations when you just know(tm) what to do on smudge and clean callbacks, ideally the filter would at least aware if the user has edited the values of the macro.
Assuming we can find a solution, whatever solution we'll find will likely end up impact this API. Perhaps then we should combine the two discussions here.
/CC @ammeep @shiftkey @nulltoken
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di libgit2/libgit2sharp
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
libgit2/libgit2sharp#2193 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
libgit2/libgit2sharp#2192 · 1 commento ·
-
Website is down Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
libgit2/libgit2sharp#2191 · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
libgit2/libgit2sharp#2189 · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
libgit2/libgit2sharp#2187 · 2 commenti ·