I'm not sure if this is something that is kind of bonkers, but I know certain repo's (such as Atlassian Stash) allow you to setup remote git hooks. We have various developers who are using a very old version of git and I was wondering if there is some way on a push to have the repo report back to them "You should upgrade from git 1.7 to something more modern".
I know locally you can setup githooks but I'm under the impression there is no way to automatically "seed" a repo with hooks - its up to the user to install them.
What I'm looking for is a methodology to inform a user upon a push or a clone that they should upgrade their git version.
We are currently using Atlassian Stash as our repo but I also have access to GitLab as well.
-- Additional Notes:
The default installed version of git is something like 1.7. I don't recall the exact situation but there is a bug we've had 3 people run into which is corrected by using a newer version of git. The IT folks won't upgrade the default version so I was looking for a work around
Unfortunately, this is not currently possible.
Git v1.7.12.1 and newer can report their version to the other side (commit), but this version information is not made available to any hooks. The only way to get at this information is to modify the git-receive-pack
executable running on the server, or to write a wrapper around git-receive-pack
that does some protocol parsing to extract the version information and do something with it.
I encourage you to send an email to the Git mailing list and ask the developers to make the client's version available in a hook environment variable (if provided by the client).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments