2018-04-12 15:07:57 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
top=$(pwd)
|
|
|
|
|
|
|
|
if [ "$#" -ne 3 ]; then
|
|
|
|
echo "USAGE: $0 repo patchdir ref"
|
2021-06-23 09:51:57 +03:00
|
|
|
printf "\t exports patches from 'repo' to 'patchdir' based on 'ref'\n"
|
2018-04-12 15:07:57 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# parameters
|
|
|
|
kernel_submodule=$1
|
|
|
|
kernel_patchdir=$2
|
|
|
|
base_ref=$3
|
|
|
|
|
|
|
|
cd "${kernel_submodule}"
|
|
|
|
echo "clearing old exported patchqueue"
|
|
|
|
rm -f "${top}/${kernel_patchdir}"/*.patch
|
|
|
|
echo "exporting patchqueue using 'git format-patch [...] ${base_ref}.."
|
|
|
|
git format-patch \
|
|
|
|
--quiet \
|
|
|
|
--no-numbered \
|
|
|
|
--no-cover-letter \
|
|
|
|
--zero-commit \
|
2018-07-04 12:50:30 +03:00
|
|
|
--no-signature \
|
2019-09-30 08:26:53 +03:00
|
|
|
--diff-algorithm=myers \
|
2018-04-12 15:07:57 +03:00
|
|
|
--output-dir \
|
|
|
|
"${top}/${kernel_patchdir}" \
|
|
|
|
"${base_ref}.."
|
|
|
|
|
2021-06-23 09:51:57 +03:00
|
|
|
git checkout "${base_ref}"
|
2018-04-12 15:07:57 +03:00
|
|
|
|
|
|
|
cd "${top}"
|