scripts: Review patch_git.sh and update-patches-git
commit20c8ea7097cea73196ca97cb7c939c43b43b047b
authorPhil Sutter <phil@nwl.cc>
Tue, 2 Nov 2021 02:15:41 +0000 (2 03:15 +0100)
committerWaldemar Brodkorb <wbx@openadk.org>
Thu, 4 Nov 2021 01:09:55 +0000 (4 02:09 +0100)
tree48485e3bb8da6fd2e415503f01744724e25e08e3
parente56d72d71632eddf2f005debf56073349c011daf
scripts: Review patch_git.sh and update-patches-git

Fix git-backed package patching and patch updating scripts:

* patch_git.sh was entirely broken (since forever?!) due to a missing
  'cd' call
* update-patches-git formatted the marker commit as patch instead of
  ignoring it

The major improvement of this review is the elimination of the mandatory
final marker commit. Putting it before the series being applied works
well and allows to add a patch to the series without demanding a
git-rebase call to get the marker back on top.

While being at it:

* Call 'git am --abort' only if there was a git repo already
* Call git-commit and git-format-patch with extra options to avoid
  side-effects from a user's .gitconfig
* Explicitly specify output format in git-log to avoid surprises, also
  split output properly with 'read'
* Eliminate fake_hdr variable

Signed-off-by: Phil Sutter <phil@nwl.cc>
scripts/patch_git.sh
scripts/update-patches-git