@@ -66,12 +66,6 @@ get_author_ident_from_commit::
outputs code for use with eval to set the GIT_AUTHOR_NAME,
GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit.
-create_virtual_base::
- modifies the first file so only lines in common with the
- second file remain. If there is insufficient common material,
- then the first file is left empty. The result is suitable
- as a virtual base input for a 3-way merge.
-
GIT
---
Part of the linkgit:git[1] suite
@@ -238,18 +238,6 @@ clear_local_git_env() {
unset $(git rev-parse --local-env-vars)
}
-# Generate a virtual base file for a two-file merge. Uses git apply to
-# remove lines from $1 that are not in $2, leaving only common lines.
-create_virtual_base() {
- sz0=$(wc -c <"$1")
- @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
- sz1=$(wc -c <"$1")
-
- # If we do not have enough common material, it is not
- # worth trying two-file merge using common subsections.
- expr $sz0 \< $sz1 \* 2 >/dev/null || : >"$1"
-}
-
# Platform specific tweaks to work around some commands
case $(uname -s) in
@@ -19,6 +19,18 @@ diff_cmd () {
fi
}
+# Generate a virtual base file for a two-file merge. Uses git apply to
+# remove lines from $1 that are not in $2, leaving only common lines.
+create_virtual_base() {
+ sz0=$(wc -c <"$1")
+ @@DIFF@@ -u -La/"$1" -Lb/"$1" "$1" "$2" | git apply --no-add
+ sz1=$(wc -c <"$1")
+
+ # If we do not have enough common material, it is not
+ # worth trying two-file merge using common subsections.
+ expr $sz0 \< $sz1 \* 2 >/dev/null || : >"$1"
+}
+
merge_cmd () {
if ! $base_present
then
Move the create_virtual_base() function out of "git-sh-setup" to its only user, "mergetools/p4merge". Since 1a92e53ba36 (merge-one-file: use empty blob for add/add base, 2016-02-23) when git-merge-one-file.sh stopped using it, it has only been used in "mergetools/p4merge". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- Documentation/git-sh-setup.txt | 6 ------ git-sh-setup.sh | 12 ------------ mergetools/p4merge | 12 ++++++++++++ 3 files changed, 12 insertions(+), 18 deletions(-)