summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/guilt/files/guilt-pop.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/guilt/files/guilt-pop.patch')
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-pop.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-devtools/guilt/files/guilt-pop.patch b/meta/recipes-devtools/guilt/files/guilt-pop.patch
new file mode 100644
index 0000000000..c26b324ccf
--- /dev/null
+++ b/meta/recipes-devtools/guilt/files/guilt-pop.patch
@@ -0,0 +1,71 @@
1guilt: pop and delete tags
2
3Add support for popping to a tag and the ability to delete
4a tag while popping from the tree
5
6Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
7
8---
9 guilt-pop | 28 ++++++++++++++++++++++++++--
10 1 file changed, 26 insertions(+), 2 deletions(-)
11
12--- a/guilt-pop
13+++ b/guilt-pop
14@@ -17,6 +17,13 @@ while [ $# -gt 0 ]; do
15 -n)
16 num=t
17 ;;
18+ -t|--t)
19+ tag=$2
20+ shift
21+ ;;
22+ -d|--d) # can only be used with --t
23+ delete_tag=t
24+ ;;
25 *)
26 break
27 ;;
28@@ -24,7 +31,7 @@ while [ $# -gt 0 ]; do
29 shift
30 done
31
32-# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo"
33+# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo" or "guilt-pop -t <tag>"
34 if [ -z "$all" ] && [ $# -gt 1 ]; then
35 usage
36 fi
37@@ -44,12 +51,26 @@ fi
38 patch="$1"
39 [ ! -z "$all" ] && patch="-a"
40
41+
42+# tag processing will just roll into another one of
43+# the pop types, number or patch name
44+if [ ! -z "$tag" ]; then
45+ git-rev-list HEAD ^$tag > /dev/null 2>/dev/null
46+ if [ $? -eq 0 ]; then
47+ revs="`git-rev-list HEAD ^$tag`"
48+ num=`echo "$revs" | wc -l`
49+ patch=$num
50+ else
51+ echo "Cannot find tag $tag";
52+ exit 0
53+ fi
54+fi
55+
56 if [ ! -s "$applied" ]; then
57 disp "No patches applied."
58 exit 0
59 elif [ "$patch" = "-a" ]; then
60 # we are supposed to pop all patches
61-
62 sidx=`wc -l < $applied`
63 eidx=0
64 elif [ ! -z "$num" ]; then
65@@ -96,3 +117,6 @@ pop_many_patches `git rev-parse refs/pat
66 p=`get_top`
67 [ ! -z "$p" ] && disp "Now at $p." || disp "All patches popped."
68
69+if [ ! -z "$delete_tag" ]; then
70+ git tag -d $tag
71+fi;