The Filter API contains singleton Entry-points which are agnostic to `FilterMode`, does having `Clean` and `Smudge` entry-points make sense?
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Refactorisation
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- csharp, git
- Domaine
- backend-api-design, tooling
Piste de recherche
Commencez par examiner la Filter API exposée et les tests associés, que l’issue identifie comme affectés par les changements de signature proposés. Examinez ensuite la manière dont les macros clean et smudge de .gitattributes sont gérées ; la finalisation nécessite une conception d’API approuvée, la mise à jour des dépendances et des tests réussis.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- C#
- Étoiles
- 3.5k
- Forks
- 925
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de libgit2/libgit2sharp
-
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
libgit2/libgit2sharp#2193 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
libgit2/libgit2sharp#2192 · 1 commentaire ·
-
Website is down Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
libgit2/libgit2sharp#2191 · 2 réactions ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
libgit2/libgit2sharp#2189 · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
libgit2/libgit2sharp#2187 · 2 commentaires ·