charmbracelet / git-lfs-transfer

Server-side implementation of the Git LFS pure-SSH protocol
MIT License
52 stars 6 forks source link

feat: allow Batch() to return key-value pairs #14

Closed KyleFromKitware closed 11 months ago

KyleFromKitware commented 11 months ago

@aymanbagabas @maaslalani @caarlos0 Could one of you please take a look at this?

aymanbagabas commented 11 months ago

Hi @KyleFromKitware, thank you for the PR. Do you mind explaining what is your use case here?

KyleFromKitware commented 11 months ago

@aymanbagabas Thanks for the reply. I'm working on adding git-lfs-transfer support to GitLab. You can see my WIP branch at https://gitlab.com/KyleFromKitware/gitlab-shell/-/tree/git-lfs-transfer.

My implementation makes use of the id and token parameters that get returned by batch and passed to get-object and put-object. Backend.Download() and Backend.StartUpload() can read these parameters, but Backend.Batch() currently has no way to return them. That's what this patch adds.

KyleFromKitware commented 11 months ago

FWIW, I've also had to make a few other changes to this repo to get it to work in gitlab-shell. You can see my fork at https://gitlab.com/KyleFromKitware/git-lfs-transfer/-/tree/fork-for-gitlab.

aymanbagabas commented 11 months ago

@KyleFromKitware I came up with a PR to resolve this in https://github.com/charmbracelet/git-lfs-transfer/pull/16, feel free to put a review. Would love it if you could upstream your logging and error handling changes 🙂

EDIT: I'm working on adding some tests and coverage

aymanbagabas commented 11 months ago

@KyleFromKitware I've created PR https://github.com/charmbracelet/git-lfs-transfer/pull/17 to use a logging interface instead of hard-coding the log statements. Lmk if the interface works for you or if you have any feedback.

KyleFromKitware commented 11 months ago

Thanks @aymanbagabas. Closing this in favor of #16.