Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: LFS pre-push requires Stdin #731

Closed
wants to merge 4 commits into from

Conversation

tdesveaux
Copy link
Contributor

@tdesveaux tdesveaux commented May 27, 2024

DRAFT: Opening as draft. I'll self-review tomorrow and look if I can add tests or update doc

Partial workaround fix for #511

⚡ Summary

git lfs pre-push hook read information on what will be pushed to remote to determine what LFS object it needs to upload.
Until now, Stdin from Git was not forwarded to it, causing it to never uploading LFS objects, which is a big issue as these objects can be lost due to pruning.

There is another change that check if multiple commands have the use_stdin option to true, as, at the moment, Stdin will be consumed by the first command executed, and others will be left hanging.

☑️ Checklist

  • Check locally
  • Add tests
  • Add documentation

@tdesveaux tdesveaux force-pushed the fix/lfs-pre-push branch 2 times, most recently from 79a4df9 to e4e934e Compare May 28, 2024 12:58
tdesveaux added 4 commits May 28, 2024 15:50
LFS is far too critical when setup in a repository to be simply ignored
Since Stdin from Git is not intercepted and forwared to each commands/scripts,
this could lead to hang.
This is only used by LFS pre-push Hook which require Stdin.
@tdesveaux
Copy link
Contributor Author

@mrexox Sorry, I won't be able to spend more time on this right now, and I don't know when I'll have more time.

I'm frankly not satisfied with how the sanity check is implemented right in the middle of run, but I didn't really know where it could be better setup since we don't know if an LFS command will run before that.
I don't really know how to test this, so I'd guidance.

I also changed the fact that LFS errors are ignored. They now stop the hook with an error code. LFS is far too important when used in a repository to ignore.

Since I'm uncertain on when I'd be available to complete this, I don't mind if any one want to take over.

@tdesveaux
Copy link
Contributor Author

taken over in #732

@tdesveaux tdesveaux closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant