summaryrefslogtreecommitdiff
path: root/scripts/update-patches-git
blob: 6f0bbfedb38d4186dc943e71b197d45217b356eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
#
# Update patches using git-format-patch from a source tree prepared by
# patch_git.sh.
#
# (c) 2021 Phil Sutter <phil@nwl.cc>

wrkdist=$1
wd=$(pwd)

cd "$wrkdist"
top="HEAD"
git log --grep='^OpenADK patch marker:' --format='%H %s'$logopt | \
		while read hash o p m series; do
	patchdir=$(<.git/patch_tmp/${series}/__patchdir__)
	while read patchfile; do
		rm ${patchdir}/$patchfile
	done < .git/patch_tmp/${series}/__patchfiles__
	git format-patch --no-numbered --no-signoff --no-cover-letter \
		--no-signature -o "$patchdir" ${hash}..${top}
	top=${hash}^
done