Documentation: extract script to generate a list of mergetools

We include the list of available mergetools into our manpages. Extract
the script that performs this logic such that we can reuse it in other
build systems.

While at it, refactor the Makefile targets such that we don't create
"mergetools-list.made" anymore. It shouldn't be necessary, as we can
instead have other targets depend on "mergetools-{diff,merge}.txt"
directly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-12-06 14:24:55 +01:00
committed by Junio C Hamano
parent 628d49f6e5
commit 023c3370ac
2 changed files with 25 additions and 14 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/sh
if test "$#" -ne 3
then
echo >&2 "USAGE: $0 <SOURCE_DIR> <MODE> <OUTPUT>"
exit 1
fi
SOURCE_DIR="$1"
TOOL_MODE="$2"
OUTPUT="$3"
MERGE_TOOLS_DIR="$SOURCE_DIR/mergetools"
(
. "$SOURCE_DIR"/git-mergetool--lib.sh &&
show_tool_names can_$TOOL_MODE
) | sed -e "s/\([a-z0-9]*\)/\`\1\`;;/" >"$OUTPUT"