update-patches-git 585 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. #
  3. # Update patches using git-format-patch from a source tree prepared by
  4. # patch_git.sh.
  5. #
  6. # (c) 2021 Phil Sutter <phil@nwl.cc>
  7. wrkdist=$1
  8. wd=$(pwd)
  9. cd "$wrkdist"
  10. top="HEAD"
  11. git log --grep='^OpenADK patch marker:' --format='%H %s'$logopt | \
  12. while read hash o p m series; do
  13. patchdir=$(<.git/patch_tmp/${series}/__patchdir__)
  14. while read patchfile; do
  15. rm ${patchdir}/$patchfile
  16. done < .git/patch_tmp/${series}/__patchfiles__
  17. git format-patch --no-numbered --no-signoff --no-cover-letter \
  18. --no-signature -o "$patchdir" ${hash}..${top}
  19. top=${hash}^
  20. done