Skip to content

Instantly share code, notes, and snippets.

@giomasce
Created December 9, 2020 11:37
Show Gist options
  • Save giomasce/98d1953265d162873f9091297f451b29 to your computer and use it in GitHub Desktop.
Save giomasce/98d1953265d162873f9091297f451b29 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Call it with incremental_patches.sh patch1 patch2 patch3
# It will modify each patch so that it first applies all the previous
# ones, then the patch itself
LAST=
for i in "$@" ; do
echo $i $LAST
if [ "x$LAST" != "x" ] ; then
cat "$LAST" "$i" > tmp
mv tmp "$i"
fi
LAST="$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment