update-patches-git 644 B

1234567891011121314151617181920212223
  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. [ -n "$(git log --oneline ${hash}..${top})" ] || continue
  14. patchdir=$(<.git/patch_tmp/${series}/__patchdir__)
  15. while read patchfile; do
  16. rm ${patchdir}/$patchfile
  17. done < .git/patch_tmp/${series}/__patchfiles__
  18. git format-patch --no-numbered --no-signoff --no-cover-letter \
  19. --no-signature -o "$patchdir" ${hash}..${top}
  20. top=${hash}^
  21. done