-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-qseries
executable file
·56 lines (50 loc) · 920 Bytes
/
git-qseries
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# Copyright (C) 2013 MORITA Kazutaka <[email protected]>
#
# This code is based on guilt-series from Guilt (Git Quilt):
# Copyright (c) Josef "Jeff" Sipek, 2006-2011
#
. git-qsh-setup
USAGE="[-v | -e]"
while case "$#" in 0) break ;; esac
do
case "$1" in
-v)
verbose=t ;;
-e)
edit=t ;;
*)
usage ;;
esac
shift
done
if [ ! -z "$edit" ]; then
git_editor "$series"
elif [ -z "$verbose" ]; then
cat "$series"
else
prefix="+"
top=`get_top`
for patch in `cat "$series"`; do
if [ -z "$top" ]; then
echo " $patch"
else
if [ "$patch" = "$top" ]; then
echo "= $patch"
prefix=" "
else
echo "$prefix $patch"
fi
fi
done
fi
# cleanup unused patches
for f in $GITQ_DIR/$branch/*; do
if [ $f = "$series" -o $f = "$applied" ]; then
continue
fi
if ! grep -q "^`basename $f`$" "$series"; then
rm $f
fi
done