forked from PyTables/PyTables
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subtree-merge-blosc.sh
executable file
·43 lines (36 loc) · 997 Bytes
/
subtree-merge-blosc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
# Script to automatically subtree merge a specifc version of blosc to
# pytables.
# TODO
# ----
#
# * Should probably check working tree and index are clean.
# configure remote
remote="git://github.com/Blosc/c-blosc.git"
# check argument
if [ -z "$1" ] ; then
echo "usage: subtree-merge-blosc.sh <blosc-tag>"
exit 1
fi
# extract the blosc tag the user has requested
blosc_tag="$1"
blosc_tag_long="refs/tags/$1"
# check that it exists on the remote side
remote_ans=$( git ls-remote $remote $blosc_tag_long )
if [ -z "$remote_ans" ] ; then
echo "no remote tag '$1' found"
exit 1
else
echo "found remote tag: '$remote_ans'"
fi
# fetch the contents of this tag
git fetch $remote $blosc_tag_long || exit 1
# subtree merge it
git merge --squash -s subtree FETCH_HEAD || exit 1
if git diff --staged --quiet ; then
echo "nothing new to be committed"
exit 1
else
# set a custom commit message
git commit -m "subtree merge blosc $blosc_tag" || exit 1
fi