Skip to content

Instantly share code, notes, and snippets.

@kraj
Last active November 3, 2023 23:06
Show Gist options
  • Save kraj/9fd27c8763aaa2943e1790d714bacee0 to your computer and use it in GitHub Desktop.
Save kraj/9fd27c8763aaa2943e1790d714bacee0 to your computer and use it in GitHub Desktop.
Apply AUH generated patches from patchwork
#!/bin/bash
if [ $# -lt 1 ]; then
echo "specify atleast one patch ID from patchwork"
echo "$0 <pnum1> <pnum2> ..."
exit
fi
i=1;
j=$#;
while [ $i -le $j ]
do
echo "Applying patch ID - $1";
git-pw patch download $1 - | sed '0,/^-- >8 --$/d' | git am -s
if [$? != 0]; then
git am --abort
else
git commit -s --reset-author --amend -C HEAD
fi
i=$((i + 1));
shift 1;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment