update-from-lore: automate updating from mailing list
When on branch T, detach the HEAD at the base of the branch, and find the newest iteration of the same topic from lore, apply the patches, and show the range-diff from what we have. Depends on having healty "amlog" notes to allow us identify what patch message resulted in the commit T, and working "b4 am" and the lore archive that lets us grab the latest iteration.todo
parent
ca61a38eca
commit
8b4e2f2218
|
|
@ -0,0 +1,52 @@
|
|||
#!/bin/sh
|
||||
|
||||
force=
|
||||
while case "$#" in 0) break;; esac
|
||||
do
|
||||
case "$1" in
|
||||
-f | --force)
|
||||
force=force ;;
|
||||
-*)
|
||||
echo >&2 "$0: unknown option '$1'"
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
case "$#" in
|
||||
0) : happy ;;
|
||||
*) echo >&2 "$0: extra arguments" ;;
|
||||
esac
|
||||
|
||||
above_master=$(git rev-list --first-parent master.. | wc -l)
|
||||
above_next=$(git rev-list --first-parent next.. | wc -l)
|
||||
if test "$above_master" != "$above_next"
|
||||
then
|
||||
if test "$force" = force
|
||||
then
|
||||
echo >&2 warning: some patches are already in next
|
||||
else
|
||||
echo >&2 fatal: some patches are already in next
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
MID=
|
||||
OLD=$(git rev-parse HEAD)
|
||||
git detach || exit
|
||||
git rev-list HEAD..$OLD |
|
||||
while read commit
|
||||
do
|
||||
git notes --ref=amlog show $commit
|
||||
done |
|
||||
sed -n -e '/^Message-Id: /{
|
||||
s///p
|
||||
q
|
||||
}' |
|
||||
xargs -n1 b4 am -o- -T |
|
||||
tee ./+b4am.mbx |
|
||||
git am -s3 && rm -f ./+b4am.mbx &&
|
||||
|
||||
git range-diff --notes=amlog --crea=999 @{-1}...
|
||||
Loading…
Reference in New Issue