diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2023-04-26 22:52:34 +0200 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2023-04-26 22:52:34 +0200 |
| commit | cdc780f044a803aff8845b949f800f0f3d095d5f (patch) | |
| tree | 6695a80568f6b4aef414070f17859f434e229957 /scripts/package/gen-diff-patch | |
| parent | HID: intel-ish-hid: Fix kernel panic during warm reset (diff) | |
| parent | HID: amd_sfh: Fix max supported HID devices (diff) | |
| download | linux-cdc780f044a803aff8845b949f800f0f3d095d5f.tar.gz linux-cdc780f044a803aff8845b949f800f0f3d095d5f.zip | |
Merge branch 'for-6.4/amd-sfh' into for-linus
- assorted functional fixes for amd-sfh driver (Basavaraj Natikar)
Diffstat (limited to 'scripts/package/gen-diff-patch')
| -rwxr-xr-x | scripts/package/gen-diff-patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/package/gen-diff-patch b/scripts/package/gen-diff-patch new file mode 100755 index 000000000000..f842ab50a780 --- /dev/null +++ b/scripts/package/gen-diff-patch @@ -0,0 +1,44 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only + +diff_patch="${1}" +untracked_patch="${2}" +srctree=$(dirname $0)/../.. + +rm -f ${diff_patch} ${untracked_patch} + +if ! ${srctree}/scripts/check-git; then + exit +fi + +mkdir -p "$(dirname ${diff_patch})" "$(dirname ${untracked_patch})" + +git -C "${srctree}" diff HEAD > "${diff_patch}" + +if [ ! -s "${diff_patch}" ]; then + rm -f "${diff_patch}" + exit +fi + +git -C ${srctree} status --porcelain --untracked-files=all | +while read stat path +do + if [ "${stat}" = '??' ]; then + + if ! diff -u /dev/null "${srctree}/${path}" > .tmp_diff && + ! head -n1 .tmp_diff | grep -q "Binary files"; then + { + echo "--- /dev/null" + echo "+++ linux/$path" + cat .tmp_diff | tail -n +3 + } >> ${untracked_patch} + fi + fi +done + +rm -f .tmp_diff + +if [ ! -s "${diff_patch}" ]; then + rm -f "${diff_patch}" + exit +fi |
