committing changes in /etc made by "-bash"

Package changes:
This commit is contained in:
2023-02-06 14:26:39 +02:00
parent e582ddedad
commit b78b22077d
157 changed files with 2583 additions and 118 deletions

View File

@@ -12,6 +12,37 @@ case "$VCS" in
#!/bin/sh
# pre-commit hook for etckeeper, to store metadata and do sanity checks
set -e
################################################################################
# Do not run etckeeper inside linked worktrees. An additional worktree can be
# very useful for resolving *.rpmsave/*.rpmnew files where you are able to merge
# and check out older versions without changing the whole content of /etc.
# However while doing such work, avoid modifying .etckeeper since only the /etc
# directory should track permissions.
#
#
# $ cd /etc
# $ git worktree list
# /etc 2984704 [main]
# /root/etc.worktree aeae148 [main.worktree]
# $ git rev-parse --git-dir
# .git
# $ cd /root/etc.worktree
# $ git rev-parse --git-dir
# /etc/.git/worktrees/etc.worktree
# $
#
################################################################################
# Using 'rev-parse' + 'grep' rather than for instance parsing output from
# 'worktree list' since the worktree command is not present in older git version
# and parsing it would be slightly more complex.
if git rev-parse --git-dir | grep -q /.git/worktrees
then
# Inside worktree, do nothing.
exit
fi
etckeeper pre-commit -d `pwd`
EOF
chmod +x .git/hooks/pre-commit