aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2016-09-25 19:26:39 +0200
committerClément Bœsch <u@pkh.me>2016-09-25 19:27:51 +0200
commit95a7cbb09de1d63ed050371a34794b3fed49b2dc (patch)
tree46542078ae1bd38517e240c89a302c1bbe235753 /tools
parent485f75b2786a8e6173e01345feea58b44aea2244 (diff)
downloadffmpeg-95a7cbb09de1d63ed050371a34794b3fed49b2dc.tar.gz
doc: move out merge script to tools
Diffstat (limited to 'tools')
-rwxr-xr-xtools/libav-merge-next-commit22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/libav-merge-next-commit b/tools/libav-merge-next-commit
new file mode 100755
index 0000000000..9bd03fabf8
--- /dev/null
+++ b/tools/libav-merge-next-commit
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ "$1" != "merge" -a "$1" != "noop" ]; then
+ printf "Usage: $0 <merge|noop [REF_HASH]>\n"
+ exit 0
+fi
+
+[ "$1" = "noop" ] && merge_opts="-s ours"
+
+nextrev=$(git rev-list libav/master --not master --no-merges | tail -n1)
+if [ -z "$nextrev" ]; then
+ printf "Nothing to merge..\n"
+ exit 0
+fi
+printf "Merging $(git log -n 1 --oneline $nextrev)\n"
+git merge --no-commit $merge_opts --no-ff --log $nextrev
+
+if [ "$1" = "noop" -a -n "$2" ]; then
+ printf "\nThis commit is a noop, see $2\n" >> .git/MERGE_MSG
+fi
+
+printf "\nMerged-by: $(git config --get user.name) <$(git config --get user.email)>\n" >> .git/MERGE_MSG