mirror of
https://github.com/systemd/systemd.git
synced 2025-01-03 05:18:09 +03:00
meson: Rename add-git-hook.sh to git-setup.sh and configure git in it
Let's automatically apply the recommended git config with meson.
This commit is contained in:
parent
c735424908
commit
6233a76932
@ -15,7 +15,7 @@ Please make sure to follow our [Coding Style](CODING_STYLE) when submitting
|
|||||||
patches. Also have a look at our [Contribution Guidelines](CONTRIBUTING).
|
patches. Also have a look at our [Contribution Guidelines](CONTRIBUTING).
|
||||||
|
|
||||||
To start, run the following commands in the systemd git repository to set up
|
To start, run the following commands in the systemd git repository to set up
|
||||||
git correctly:
|
git correctly (running `meson` will run these commands for you automatically):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ git config submodule.recurse true
|
$ git config submodule.recurse true
|
||||||
|
@ -66,9 +66,9 @@ summary({'build mode' : get_option('mode')})
|
|||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# Try to install the git pre-commit hook
|
# Try to install the git pre-commit hook
|
||||||
add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false)
|
git_setup_sh = find_program('tools/git-setup.sh', required : false)
|
||||||
if add_git_hook_sh.found()
|
if git_setup_sh.found()
|
||||||
git_hook = run_command(add_git_hook_sh, check : false)
|
git_hook = run_command(git_setup_sh, check : false)
|
||||||
if git_hook.returncode() == 0
|
if git_hook.returncode() == 0
|
||||||
message(git_hook.stdout().strip())
|
message(git_hook.stdout().strip())
|
||||||
endif
|
endif
|
||||||
|
@ -4,6 +4,11 @@ set -eu
|
|||||||
|
|
||||||
cd "${MESON_SOURCE_ROOT:?}"
|
cd "${MESON_SOURCE_ROOT:?}"
|
||||||
|
|
||||||
|
if [ -e .git ]; then
|
||||||
|
git config submodule.recurse true
|
||||||
|
git config fetch.recurseSubmodules on-demand
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f .git/hooks/pre-commit.sample ] || [ -f .git/hooks/pre-commit ]; then
|
if [ ! -f .git/hooks/pre-commit.sample ] || [ -f .git/hooks/pre-commit ]; then
|
||||||
exit 2 # not needed
|
exit 2 # not needed
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user