Community
Participate
Working Groups
pre-push hook is executed always and in case of dry-run and git-lfs push it tranfers binary data to LFS server. In case of Eclipse (EGit) this cannot be aborted and binary data always is sent. If we skip pre-push hook in case of Transporet.isDryRun() is true, than it will not execute other not LFS related pre-push hook too. How can we do it only for LFS related hook?
I think you'd get the same problem with command-line git on git push --dry-run. Compare https://github.com/git-lfs/git-lfs/issues/3418 . On the command-line, one could do git push --dry-run --no-verify. JGit's Transport.java has no support for an equivalent of --no-verify. But maybe here the hook specification of git is broken. The information about whether a certain command is being dry-run should be passed on to hooks (maybe as an optional command-line parameter, or via an environment variable) so that a hook could do whatever was appropriate.
Yes, you are right: the native "git push --dry-run" also executes the Git LFS hook and it transfers the data. I thought also of the way how to call pre-hook with the information we have a dry run, but did not found any possibility. Here Git have to be extended...
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/191930
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/191930 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=a171360292cedde6f05a40069e36946a8045a6a1