diff options
author | Denton Liu | 2017-12-14 01:03:23 -0500 |
---|---|---|
committer | Denton Liu | 2017-12-14 01:03:23 -0500 |
commit | 1e960e6effb1d0179efb73aa0ad69a5e8379993e (patch) | |
tree | 31f86edbe2c7d242ef275b25895565f9e6208d40 | |
parent | 0f06cb49a6b3351e8b8d3dd89a6f331fc91ee945 (diff) | |
download | aur-1e960e6effb1d0179efb73aa0ad69a5e8379993e.tar.gz |
Improve branch update script
-rwxr-xr-x | convert-branch.sh | 16 | ||||
-rwxr-xr-x | update-branch.sh | 26 |
2 files changed, 26 insertions, 16 deletions
diff --git a/convert-branch.sh b/convert-branch.sh deleted file mode 100755 index b0e4efc11efc..000000000000 --- a/convert-branch.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -git filter-branch -f --subdirectory-filter trunk -git filter-branch -f --tree-filter 'makepkg --printsrcinfo > .SRCINFO || rm .SRCINFO' --commit-filter ' - if [ -e .SRCINFO ] - then - git commit-tree "$@" - else - shift - while [ -n "$1" ] - do - shift - map "$1" - shift - done - fi' diff --git a/update-branch.sh b/update-branch.sh new file mode 100755 index 000000000000..5c26decb7718 --- /dev/null +++ b/update-branch.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +REMOTE_BRANCH=packages/grub +LOCAL_BRANCH=upstream +CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD` + +git checkout "$REMOTE_BRANCH" +git pull +git branch -f "$LOCAL_BRANCH" "$REMOTE_BRANCH" +git checkout "$LOCAL_BRANCH" +git filter-branch -f --subdirectory-filter trunk \ + --tree-filter 'makepkg --printsrcinfo > .SRCINFO || rm .SRCINFO' \ + --commit-filter ' + if [ -e .SRCINFO ] + then + git commit-tree "$@" + else + shift + while [ -n "$1" ] + do + shift + map "$1" + shift + done + fi' +git checkout "$CURRENT_BRANCH" |