Open alex-ball opened 2 years ago
Currently, only the pre-push
hook is supported, although I'm not sure if this works with flatpak.
@Murmele do you know if flatpak needs additional permissions to execute programs outside its sandbox even if they're within opened directories?
Also, the pre-push
requires bash for some reason? I think this restriction should be lifted
currently for the merge commands we are leaving the flatpak sandbox.
there we are using flatpak-spawn --host sh -c "<command>"
to execute a command on the host system. It works withouth any additional permissions
It depends on what is written in the script. If some host commands are used then it will not work (or only if executed from host). If just common commands are used I have to check
@exactly-one-kas how it behaves without sandbox? Do I have to do chmod +x first on those files, or is git able to execute them without?
Git calls them as executables and requires the executable bit to be set, so I'd say we should use flatpack-spawn --host "<path to hook>"
Git calls them as executables and requires the executable bit to be set, so I'd say we should use
flatpack-spawn --host "<path to hook>"
yes I think that makes it easier. The question is are we then going around some sandboxing features?
Since we're running arbitrary scripts on the host, I'd say yes. Can we run them inside the sandbox or is that prevented?
I think that should be also possible.
For future consideration:
I think .git/hooks/pre-commit
is the most common/useful, so if there's much work to support each type of hook, it's best to start with the most important one.
I just implemented a prepare-commit-hook and learned gittyup does not execute it. I see this functionality as very important, as the hooks are one of the few ways to mitigate some of the worst design fails of git...
So from me: please, hooks are important, please implement
I am running Gittyup v1.1.2 on Ubuntu 20.04 via flatpak.
Expected behaviour: In a Git repo with executable files at
.git/hooks/pre-commit
and.git/hooks/post-commit
, committing some changes should run those two scripts immediately before and after the commit, respectively.Actual behaviour: The commit succeeds but the two files do not execute.
I'm afraid I don't know enough about these things to know if
I have not tested whether the other Git hooks are triggered (by push, receive, etc.).