mk_format_patch: Copy only those patches that have changes in chunks

This commit is contained in:
The-going
2024-07-03 12:43:00 +03:00
committed by Igor
parent 0a3411ec05
commit 82225ac5a1

View File

@@ -25,10 +25,17 @@ ii_cp()
local new_p=$1
local old_p=$2
# Patches can be extracted in several ways.
# Copy only those patches that have changes in chunks,
# line numbers, or source text.
# Ignore lines that may be changed by another method
# of extracting (creating) the patch.
if [ "$(diff -N \
--ignore-matching-lines="^From [0-9a-f]\{40\}" \
--ignore-matching-lines="^index [0-9a-f]\{7\}" \
--ignore-matching-lines="^Subject:" \
--ignore-matching-lines='/.*/* |[ ][ 1-9]' \
--ignore-matching-lines='^Armbian$' \
--ignore-matching-lines="^[2-3].[1-9][0-9]" \
$old_p $new_p 2>/dev/null)" != "" ]
then
@@ -170,7 +177,7 @@ then
prefix=""
$(git -C $url_t \
format-patch --filename-max-length=75 $range \
format-patch --filename-max-length=75 --abbrev=12 $range \
-o $tmp_dir/$target_name
) 2>/dev/null