mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 03:01:15 -03:00
CONTRIBUTING: remove Git pre-push hook
- this is not specific to fish and only relevant to people who push directly to master - we don't push directly to master as often anymore - I don't think we used it much in practice (when we should have). - a good portion of contributions is pushed with jj which probably does this differently Let's remove it even though this is a nice piece of documentation. I guess we could add it back to doc_internal/ if we have the capacity to maintain it.
This commit is contained in:
@@ -236,44 +236,6 @@ Or you can run them on a fish, without involving cmake::
|
||||
Here, the first argument to test_driver.py refers to a directory with ``fish``, ``fish_indent`` and ``fish_key_reader`` in it.
|
||||
In this example we're in the root of the git repo and have run ``cargo build`` without ``--release``, so it's a debug build.
|
||||
|
||||
Git hooks
|
||||
---------
|
||||
|
||||
Since developers sometimes forget to run the tests, it can be helpful to
|
||||
use git hooks (see githooks(5)) to automate it.
|
||||
|
||||
One possibility is a pre-push hook script like this one:
|
||||
|
||||
.. code:: sh
|
||||
|
||||
#!/bin/sh
|
||||
#### A pre-push hook for the fish-shell project
|
||||
# This will run the tests when a push to master is detected, and will stop that if the tests fail
|
||||
# Save this as .git/hooks/pre-push and make it executable
|
||||
|
||||
protected_branch='master'
|
||||
|
||||
# Git gives us lines like "refs/heads/frombranch SOMESHA1 refs/heads/tobranch SOMESHA1"
|
||||
# We're only interested in the branches
|
||||
isprotected=false
|
||||
while read from _ to _; do
|
||||
if [ "$to" = "refs/heads/$protected_branch" ]; then
|
||||
isprotected=true
|
||||
fi
|
||||
done
|
||||
if "$isprotected"; then
|
||||
echo "Running checks before push to master"
|
||||
build_tools/check.sh
|
||||
fi
|
||||
|
||||
This will check if the push is to the master branch and, if it is, only
|
||||
allow the push if running ``build_tools/check.sh`` succeeds. In some circumstances
|
||||
it may be advisable to circumvent this check with
|
||||
``git push --no-verify``, but usually that isn’t necessary.
|
||||
|
||||
To install the hook, place the code in a new file
|
||||
``.git/hooks/pre-push`` and make it executable.
|
||||
|
||||
Contributing Translations
|
||||
=========================
|
||||
|
||||
|
||||
@@ -50,8 +50,6 @@ function __fish_help_describe -a help_item
|
||||
return
|
||||
case contributing#fish-script-style-guide
|
||||
return
|
||||
case contributing#git-hooks
|
||||
return
|
||||
case contributing#github
|
||||
return
|
||||
case contributing#guidelines
|
||||
|
||||
Reference in New Issue
Block a user