aboutsummaryrefslogtreecommitdiff
path: root/tools/generate-script.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-24 12:25:21 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-24 12:25:21 -0700
commit2d733b9660700fa4dd03a89d9003b8865b99bf4d (patch)
tree5971dfb5227790af0ff1ba5b2696cc4994ba58aa /tools/generate-script.sh
parent6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad (diff)
parent671df48df895fdf259b48a7f90b70b7c75fc4059 (diff)
downloadgit-2d733b9660700fa4dd03a89d9003b8865b99bf4d.tar.xz
Merge branch 'ps/build-tweaks' into rs/use-strvec-pushv
The topic moves the coccinelle rules from contrib/ to tools/ directory, breaking merges with this topic. * ps/build-tweaks: meson: precompile "git-compat-util.h" meson: compile compatibility sources separately git-compat-util.h: move warning infra to prepare for PCHs builds: move build scripts into "tools/" contrib: move "update-unicode.sh" script into "tools/" contrib: move "coverage-diff.sh" script into "tools/" contrib: move "coccinelle/" directory into "tools/" Introduce new "tools/" directory
Diffstat (limited to 'tools/generate-script.sh')
-rwxr-xr-xtools/generate-script.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/generate-script.sh b/tools/generate-script.sh
new file mode 100755
index 0000000000..a149e4f0ba
--- /dev/null
+++ b/tools/generate-script.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 3
+then
+ echo >&2 "USAGE: $0 <INPUT> <OUTPUT> <GIT-BUILD-OPTIONS>"
+ exit 1
+fi
+
+INPUT="$1"
+OUTPUT="$2"
+BUILD_OPTIONS="$3"
+
+. "$BUILD_OPTIONS"
+
+sed -e "1s|#!.*/sh|#!$SHELL_PATH|" \
+ -e "s|@SHELL_PATH@|$SHELL_PATH|" \
+ -e "s|@DIFF@|$DIFF|" \
+ -e "s|@LOCALEDIR@|$LOCALEDIR|g" \
+ -e "s/@USE_GETTEXT_SCHEME@/$USE_GETTEXT_SCHEME/g" \
+ -e "$BROKEN_PATH_FIX" \
+ -e "s|@GITWEBDIR@|$GITWEBDIR|g" \
+ -e "s|@PERL_PATH@|$PERL_PATH|g" \
+ -e "s|@PAGER_ENV@|$PAGER_ENV|g" \
+ "$INPUT" >"$OUTPUT"
+
+case "$(basename "$INPUT")" in
+git-mergetool--lib.sh|git-sh-i18n.sh|git-sh-setup.sh)
+ ;;
+*)
+ chmod a+x "$OUTPUT"
+ ;;
+esac