summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-import-commit.patch96
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-init.patch25
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-pop.patch73
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-push-no-series.patch29
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-push.patch42
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-set-git_exec_path.patch29
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-update-supported-git-versions-to-1.8.x.patch28
-rw-r--r--meta/recipes-devtools/guilt/files/guilt.patch319
-rw-r--r--meta/recipes-devtools/guilt/files/improve_auto_header_gen.patch71
-rw-r--r--meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch48
-rw-r--r--meta/recipes-devtools/guilt/files/optional_head_check.patch60
-rw-r--r--meta/recipes-devtools/guilt/files/uninstall_force.patch14
-rw-r--r--meta/recipes-devtools/guilt/guilt-native_0.33.bb35
-rw-r--r--meta/recipes-devtools/guilt/guilt-native_git.bb26
14 files changed, 26 insertions, 869 deletions
diff --git a/meta/recipes-devtools/guilt/files/guilt-import-commit.patch b/meta/recipes-devtools/guilt/files/guilt-import-commit.patch
deleted file mode 100644
index bd746c5e83..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-import-commit.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1guilt: import commits via git format-patch
2
3Rather than attempting to process commits directly, it
4is preferable to try dumping the change via git format-patch
5to take advantage of the proper header/subject/from lines that
6are generated.
7
8If patches cannot be exported, fall back to importing
9commits via a more custom method.
10
11Upstream-Status: Inappropriate [oe-specific]
12
13Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
14
15---
16 guilt-import-commit | 40 +++++++++++++++++++++++++++++-----------
17 1 file changed, 29 insertions(+), 11 deletions(-)
18
19--- a/guilt-import-commit
20+++ b/guilt-import-commit
21@@ -20,46 +20,64 @@ fi
22 disp "About to begin conversion..." >&2
23 disp "Current head: `cat $GIT_DIR/refs/heads/$branch`" >&2
24
25+# try git-format-patch first, if it fails fall back to internal
26+# methods.
27+patches=`git-format-patch -o $GUILT_DIR/$branch $rhash`
28+if [ -z "$patches" ]; then
29+ need_custom_patches="1"
30+fi
31+
32 for rev in `git rev-list $rhash`; do
33+ if [ ! -z "$need_custom_patches" ]; then
34 s=`git log --pretty=oneline -1 $rev | cut -c 42-`
35
36 fname=`echo $s | sed -e "s/&/and/g" -e "s/[ :]/_/g" -e "s,[/\\],-,g" \
37- -e "s/['\\[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
38+ -e "s/['\\()<>[{}]//g" -e 's/]//g' -e 's/\*/-/g' \
39 -e 's/\?/-/g' | tr A-Z a-z`
40
41- disp "Converting `echo $rev | cut -c 1-8` as $fname"
42+ disp "Converting `echo $rev | cut -c 1-8` as $fname.patch"
43
44 mangle_prefix=1
45 fname_base=$fname
46- while [ -f "$GUILT_DIR/$branch/$fname" ]; do
47+ while [ -f "$GUILT_DIR/$branch/$fname.patch" ]; do
48 fname="$fname_base-$mangle_prefix"
49 mangle_prefix=`expr $mangle_prefix + 1`
50- disp "Patch under that name exists...trying '$fname'"
51+ disp "Patch under that name exists...trying '$fname.patch'"
52 done
53
54 (
55 do_make_header $rev
56 echo ""
57 git diff --binary $rev^..$rev
58- ) > $GUILT_DIR/$branch/$fname
59+ ) > $GUILT_DIR/$branch/$fname.patch
60
61 # FIXME: grab the GIT_AUTHOR_DATE from the commit object and set the
62 # timestamp on the patch
63
64- # insert the patch name into the series file
65- series_insert_patch $fname
66+ patches="$patches $fname.patch"
67+ fi
68
69- # Only reset if the commit was on this branch
70- if head_check $rev 2> /dev/null; then
71+ # Only reset if the commit was on this branch
72+ if head_check $rev 2> /dev/null; then
73 # BEWARE: "git reset" ahead! Is there a way to verify that
74 # we really created a patch? - We don't want to lose any
75 # history.
76 git reset --hard $rev^ > /dev/null
77- elif [ -z "$warned" ]; then
78+ elif [ -z "$warned" ]; then
79 disp "Warning: commit $rev is not the HEAD...preserving commit" >&2
80 disp "Warning: (this message is displayed only once)" >&2
81 warned=t
82- fi
83+ fi
84+done
85+
86+rpatches=`echo "$patches" | sed 's% %\n%g' | tac`
87+for patch in $rpatches; do
88+
89+ iname=`echo $patch | sed s%$GUILT_DIR/$branch/%%`
90+ echo "Inserting $iname"
91+
92+ # insert the patch name into the series file
93+ series_insert_patch $iname
94 done
95
96 disp "Done." >&2
diff --git a/meta/recipes-devtools/guilt/files/guilt-init.patch b/meta/recipes-devtools/guilt/files/guilt-init.patch
deleted file mode 100644
index 1583346ed6..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-init.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1guilt: allow previously initialized branches to be re-initialized
2
3Upstream-Status: Inappropriate [oe-specific]
4
5Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
6
7---
8 guilt-init | 6 +++---
9 1 file changed, 3 insertions(+), 3 deletions(-)
10
11--- a/guilt-init
12+++ b/guilt-init
13@@ -20,9 +20,9 @@ while case $# in 0) break ;; esac; do
14 shift
15 done
16
17-if [ -d "$GUILT_DIR/$branch" ]; then
18- die "Branch $branch appears to be already initialized (GIT_DIR=$GIT_DIR)"
19-fi
20+# if [ -d "$GUILT_DIR/$branch" ]; then
21+# die "Branch $branch appears to be already initialized (GIT_DIR=$GIT_DIR)"
22+# fi
23
24 [ ! -d "$GUILT_DIR" ] && mkdir "$GUILT_DIR"
25 mkdir -p "$GUILT_DIR/$branch"
diff --git a/meta/recipes-devtools/guilt/files/guilt-pop.patch b/meta/recipes-devtools/guilt/files/guilt-pop.patch
deleted file mode 100644
index 9c0542740f..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-pop.patch
+++ /dev/null
@@ -1,73 +0,0 @@
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
6Upstream-Status: Inappropriate [oe-specific]
7
8Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
9
10---
11 guilt-pop | 28 ++++++++++++++++++++++++++--
12 1 file changed, 26 insertions(+), 2 deletions(-)
13
14--- a/guilt-pop
15+++ b/guilt-pop
16@@ -17,6 +17,13 @@ while [ $# -gt 0 ]; do
17 -n)
18 num=t
19 ;;
20+ -t|--t)
21+ tag=$2
22+ shift
23+ ;;
24+ -d|--d) # can only be used with --t
25+ delete_tag=t
26+ ;;
27 *)
28 break
29 ;;
30@@ -24,7 +31,7 @@ while [ $# -gt 0 ]; do
31 shift
32 done
33
34-# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo"
35+# "guilt-pop" or "guilt-pop foo" or "guilt-pop -n foo" or "guilt-pop -t <tag>"
36 if [ -z "$all" ] && [ $# -gt 1 ]; then
37 usage
38 fi
39@@ -44,12 +51,26 @@ fi
40 patch="$1"
41 [ ! -z "$all" ] && patch="-a"
42
43+
44+# tag processing will just roll into another one of
45+# the pop types, number or patch name
46+if [ ! -z "$tag" ]; then
47+ git-rev-list HEAD ^$tag > /dev/null 2>/dev/null
48+ if [ $? -eq 0 ]; then
49+ revs="`git-rev-list HEAD ^$tag`"
50+ num=`echo "$revs" | wc -l`
51+ patch=$num
52+ else
53+ echo "Cannot find tag $tag";
54+ exit 0
55+ fi
56+fi
57+
58 if [ ! -s "$applied" ]; then
59 disp "No patches applied."
60 exit 0
61 elif [ "$patch" = "-a" ]; then
62 # we are supposed to pop all patches
63-
64 sidx=`wc -l < $applied`
65 eidx=0
66 elif [ ! -z "$num" ]; then
67@@ -96,3 +117,6 @@ pop_many_patches `git rev-parse refs/pat
68 p=`get_top`
69 [ ! -z "$p" ] && disp "Now at $p." || disp "All patches popped."
70
71+if [ ! -z "$delete_tag" ]; then
72+ git tag -d $tag
73+fi;
diff --git a/meta/recipes-devtools/guilt/files/guilt-push-no-series.patch b/meta/recipes-devtools/guilt/files/guilt-push-no-series.patch
deleted file mode 100644
index 3446f10422..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-push-no-series.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1guilt-push: Avoid duplicate hits in a series
2
3If a series file becomes mangled and a patch name appears in there
4more than once, then the guilt-push will fail a horrible and
5incomprehensible death. Make it fail in a sensible way.
6
7Upstream-Status: Inappropriate [oe-specific]
8
9Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
10
11---
12
13 guilt-push | 5 +++++
14 1 file changed, 5 insertions(+)
15
16--- a/guilt-push
17+++ b/guilt-push
18@@ -90,6 +90,11 @@ else
19 if [ -z "$eidx" ]; then
20 die "Patch $patch is not in the series or is guarded."
21 fi
22+
23+ matches=`echo $eidx | wc -w`
24+ if [ $matches -gt 1 ]; then
25+ die "Patch $patch is in the series multiple times"
26+ fi
27 fi
28
29 # make sure that there are no unapplied changes
diff --git a/meta/recipes-devtools/guilt/files/guilt-push.patch b/meta/recipes-devtools/guilt/files/guilt-push.patch
deleted file mode 100644
index 5ec290b5d9..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-push.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1guilt: add support for pushing and tagging
2
3It can be handy to push AND tag at the same time.
4
5Upstream-Status: Inappropriate [oe-specific]
6
7Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
8
9---
10
11 guilt-push | 16 +++++++++++++++-
12 1 file changed, 15 insertions(+), 1 deletion(-)
13
14--- a/guilt-push
15+++ b/guilt-push
16@@ -19,7 +19,11 @@ while [ $# -gt 0 ]; do
17 -n)
18 num=t
19 ;;
20- *)
21+ -t|--t)
22+ tag=$2
23+ shift
24+ ;;
25+ *)
26 break
27 ;;
28 esac
29@@ -126,3 +130,13 @@ do
30 fi
31 done
32
33+ret=$?
34+if [ $ret -ne 0 ]; then
35+ exit $ret
36+fi
37+
38+# if a tag was specified, tag the tree now.
39+if [ -n "$tag" ]; then
40+ git-rev-parse HEAD > "$GIT_DIR/refs/tags/$tag"
41+fi
42+
diff --git a/meta/recipes-devtools/guilt/files/guilt-set-git_exec_path.patch b/meta/recipes-devtools/guilt/files/guilt-set-git_exec_path.patch
deleted file mode 100644
index a40ec6f21e..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-set-git_exec_path.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1guilt: set GIT_EXEC_PATH in guilt wrapper
2
3git has the habit of tracking the directory where it was
4installed. If you build git, relocate git and then remove
5the old directory --exec-path will return that original
6(now non-existent) directory. We insist that git and
7guilt be in the same directory to ensure they are matched,
8so we use the environment variable GIT_EXEC_PATH to
9force the issue.
10
11Upstream-Status: Inappropriate [oe-specific]
12
13Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
14
15---
16 guilt | 2 ++
17 1 file changed, 2 insertions(+)
18
19--- a/guilt
20+++ b/guilt
21@@ -23,6 +23,8 @@ esac
22 # we change directories ourselves
23 SUBDIRECTORY_OK=1
24
25+export GIT_EXEC_PATH=`dirname $0`/../libexec/git-core
26+
27 if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then
28 . "$(git --exec-path)/git-sh-setup"
29 fi
diff --git a/meta/recipes-devtools/guilt/files/guilt-update-supported-git-versions-to-1.8.x.patch b/meta/recipes-devtools/guilt/files/guilt-update-supported-git-versions-to-1.8.x.patch
deleted file mode 100644
index 579d9bc6fa..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt-update-supported-git-versions-to-1.8.x.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From d7fb5d4e159071b6255181fcf436300038fe9e6c Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@windriver.com>
3Date: Wed, 16 Jan 2013 20:48:11 -0500
4Subject: [PATCH] guilt: update supported git versions to 1.8.x
5
6guilt errors on the new 1.8.x git series, when it shouldn't, since
71.8.x works fine with the existing guilt version.
8
9Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
10---
11 guilt | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/guilt b/guilt
15index 346f929..6505653 100755
16--- a/guilt
17+++ b/guilt
18@@ -37,6 +37,7 @@ case "$gitver" in
19 1.5.*) ;; # git config
20 1.6.*) ;; # git config
21 1.7.*) ;; # git config
22+ 1.8.*) ;; # git config
23 *) die "Unsupported version of git ($gitver)" ;;
24 esac
25
26--
271.7.10.4
28
diff --git a/meta/recipes-devtools/guilt/files/guilt.patch b/meta/recipes-devtools/guilt/files/guilt.patch
deleted file mode 100644
index 8e5b61edc5..0000000000
--- a/meta/recipes-devtools/guilt/files/guilt.patch
+++ /dev/null
@@ -1,319 +0,0 @@
1guilt: enhanced patch queue management
2
3guilt prefers to track the status and series of patches
4under .git/patches. But this location doesn't allow the
5status of a quilt queue to be committed to a secondary
6repository and later restored.
7
8This change does three things:
9
10 - allows GUILT_BASE to be changed (with a default to "wrs")
11 - allows shadow tracking of the patches (for rebase)
12 - enhances the header detection and creation of patches
13 as they are pushed onto the tree.
14
15Upstream-Status: Inappropriate [oe-specific]
16
17Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
18
19---
20 guilt | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
21 1 file changed, 159 insertions(+), 24 deletions(-)
22
23--- a/guilt
24+++ b/guilt
25@@ -153,14 +153,16 @@ get_branch()
26
27 verify_branch()
28 {
29- [ ! -d "$GIT_DIR/patches" ] &&
30+ [ ! -d "$GUILT_DIR" ] &&
31 die "Patches directory doesn't exist, try guilt-init"
32- [ ! -d "$GIT_DIR/patches/$branch" ] &&
33+ [ ! -d "$GUILT_DIR/$branch" ] &&
34 die "Branch $branch is not initialized, try guilt-init"
35- [ ! -f "$GIT_DIR/patches/$branch/series" ] &&
36+ [ ! -f "$GUILT_DIR/$branch/series" ] &&
37 die "Branch $branch does not have a series file"
38- [ ! -f "$GIT_DIR/patches/$branch/status" ] &&
39+ [ ! -f "$GUILT_DIR/$branch/status" ] &&
40 die "Branch $branch does not have a status file"
41+ [ -f "$GUILT_DIR/$branch/applied" ] &&
42+ die "Warning: Branch $branch has 'applied' file - guilt is not compatible with stgit"
43 [ -f "$GIT_DIR/patches/$branch/applied" ] &&
44 die "Warning: Branch $branch has 'applied' file - guilt is not compatible with stgit"
45 }
46@@ -339,6 +341,17 @@ BEGIN{}
47 '
48 }
49
50+# usage: do_get_only_patch patchfile
51+# similar to do_get_patch except everything leading up to
52+# the first diff line and after the last chunk are removed
53+do_get_only_patch()
54+{
55+ cat "$1" | awk '
56+BEGIN{}
57+/^(diff )/,/^(-- |END{})/
58+' | sed '/^-- *$/D'
59+}
60+
61 # usage: do_get_header patchfile
62 do_get_header()
63 {
64@@ -352,8 +365,13 @@ do_get_header()
65 BEGIN{skip=0}
66 /^Subject:/ && (NR==1){print substr($0, 10); next}
67 /^From:/{skip=1; next}
68+/^Author:/{skip=1; next}
69+/^Date:/{skip=1; next}
70+/^commit/{skip=1; next}
71 /^[ \t\f\n\r\v]*$/ && (skip==1){skip=0; next}
72 /^(diff |---$|--- )/{exit}
73+/^diff --git/{exit}
74+/^Index: /{exit}
75 {print $0}
76 END{}
77 '
78@@ -415,6 +433,15 @@ series_insert_patch()
79 mv "$series.tmp" "$series"
80 }
81
82+series_append_patch()
83+{
84+ # unlike series_insert_patch, which inserts the passed
85+ # patch after the current top patch, this function always
86+ # appends the patch to the series
87+
88+ echo $1 >> "$series"
89+}
90+
91 # usage: series_remove_patch <patchname>
92 series_remove_patch()
93 {
94@@ -473,8 +500,7 @@ remove_patch_refs()
95 # usage: pop_many_patches <commitish> <number of patches>
96 pop_many_patches()
97 {
98- assert_head_check
99-
100+ head_check "`tail -1 < "$applied" | cut -d: -f 1`"
101 (
102 cd_to_toplevel
103
104@@ -508,50 +534,149 @@ remove_ref()
105 )
106 }
107
108+prep_patch()
109+{
110+ patch=$1;
111+ tgt=$2;
112+
113+ if test -f $patch; then
114+ case $patch in
115+ *.gz) gzip -dc $patch > $tgt ;;
116+ *.bz2) bzip2 -dc $patch > $tgt ;;
117+ *) cp $patch $tgt ;;
118+ esac;
119+ fi;
120+}
121+
122 # usage: commit patchname parent
123 commit()
124 {
125 (
126 TMP_MSG=`get_tmp_file msg`
127+ TMP_PATCH=`get_tmp_file patch`
128+ TMP_PATCH_OUT=`get_tmp_file patch_out`
129+ TMP_INFO=`get_tmp_file info`
130
131 p="$GUILT_DIR/$branch/$1"
132 pname="$1"
133+ prep_patch "$p" "$TMP_PATCH"
134+ p=$TMP_PATCH
135+
136 cd_to_toplevel
137
138 git diff-files --name-only | (while read n; do git update-index "$n" ; done)
139
140+ # borrowed from git-am
141+ header_type=git
142+ git mailinfo "$TMP_MSG" "$TMP_PATCH_OUT" \
143+ <"$p" >"$TMP_INFO";
144+
145+ # skip pine's internal folder data
146+ grep '^Author: Mail System Internal Data$' \
147+ <"$TMP_INFO" >/dev/null
148+
149+ git stripspace < "$TMP_MSG" > "$TMP_MSG.clean"
150+ mv "$TMP_MSG.clean" "$TMP_MSG"
151+ git stripspace < "$TMP_INFO" > "$TMP_INFO.clean"
152+ mv "$TMP_INFO.clean" "$TMP_INFO"
153+
154+ # If mailinfo couldn't get something , try another way
155 # grab a commit message out of the patch
156- do_get_header "$p" > "$TMP_MSG"
157+ if [ ! -s "$TMP_MSG" ] || [ ! -s "$TMP_INFO" ]; then
158+ do_get_header "$p" > "$TMP_MSG"
159+ header_type=guilt
160+ fi
161
162- # make a default commit message if patch doesn't contain one
163- [ ! -s "$TMP_MSG" ] && echo "patch $pname" > "$TMP_MSG"
164+ # last try: make a default commit message if patch doesn't contain one
165+ [ ! -s "$TMP_MSG" ] && echo "auto_msg: patch $pname" > "$TMP_MSG"
166
167- # extract a From line from the patch header, and set
168- # GIT_AUTHOR_{NAME,EMAIL}
169- author_str=`sed -n -e '/^From:/ { s/^From: //; p; q; }; /^(diff |---$|--- )/ q' "$p"`
170- if [ ! -z "$author_str" ]; then
171+
172+ if [ "$header_type" = "guilt" ]; then
173+
174+ # extract a From line from the patch header, and set
175+ # GIT_AUTHOR_{NAME,EMAIL}
176+ author_str=`sed -n -e '/^From:/ { s/^From: //; p; q }; /^(diff |---)/ q' "$p"`
177+ if [ ! -z "$author_str" ]; then
178 GIT_AUTHOR_NAME=`echo $author_str | sed -e 's/ *<.*$//'`
179 export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-" "}"
180 export GIT_AUTHOR_EMAIL="`echo $author_str | sed -e 's/[^<]*//'`"
181- fi
182+ fi
183+
184+
185+ # check in the patch for a subject
186+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$p")"
187+ if [ -z "$SUBJECT" ]; then
188+ # if we can't find a subject in the patch, then let's construct
189+ # one from the header of the patch itself
190+ SUBJECT=`cat "$TMP_MSG" | head -n 1`
191+ if [ ${#SUBJECT} -gt 60 ]; then
192+ SUBJECT=${SUBJECT: -60}
193+ fi
194+ fi
195+
196+ if [ -z "$SUBJECT" ]; then
197+ # if we are *still* without a subject, then just use
198+ # the patch name
199+ SUBJECT=`echo $1 | sed 's%^patch *%%'`
200+
201+ if [ ${#SUBJECT} -gt 60 ]; then
202+ SUBJECT=${SUBJECT: -60}
203+ fi
204+ fi
205
206- # must strip nano-second part otherwise git gets very
207- # confused, and makes up strange timestamps from the past
208- # (chances are it decides to interpret it as a unix
209- # timestamp).
210- export GIT_AUTHOR_DATE="`stat -c %y "$p" | sed -e '
211+ SUBJECT=`echo $SUBJECT | sed s'%^ *%%'`
212+
213+ if [ ! -z "$SUBJECT" ]; then
214+ echo "$SUBJECT" >> $TMP_MSG.subject
215+ echo "" >> $TMP_MSG.subject
216+ cat "$TMP_MSG" >> $TMP_MSG.subject
217+ mv "$TMP_MSG.subject" "$TMP_MSG"
218+ fi
219+
220+ # must strip nano-second part otherwise git gets very
221+ # confused, and makes up strange timestamps from the past
222+ # (chances are it decides to interpret it as a unix
223+ # timestamp).
224+ export GIT_AUTHOR_DATE="`stat -c %y "$p" | sed -e '\
225 s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/'`"
226- export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
227+ export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
228+ else
229+ # using git headers, closely related to git-am
230+
231+ GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$TMP_INFO")"
232+ GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$TMP_INFO")"
233+ GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$TMP_INFO")"
234+ if test -z "$GIT_AUTHOR_EMAIL"
235+ then
236+ echo "Warning: patch does not have a valid e-mail address."
237+ GIT_AUTHOR_EMAIL=$GIT_AUTHOR_NAME
238+ fi
239+
240+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$TMP_INFO")"
241+ if [ ! -z "$SUBJECT" ]; then
242+ echo "$SUBJECT" >> $TMP_MSG.subject
243+ echo "" >> $TMP_MSG.subject
244+ cat "$TMP_MSG" >> $TMP_MSG.subject
245+ mv "$TMP_MSG.subject" "$TMP_MSG"
246+ fi
247+ export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
248+ fi
249
250 # commit
251 treeish=`git write-tree`
252 commitish=`git commit-tree $treeish -p $2 < "$TMP_MSG"`
253+ if [ ! $? -eq 0 ]; then
254+ echo "ERROR. Could not commit tree"
255+ git-reset --hard HEAD^
256+ exit 1
257+ fi
258 git update-ref HEAD $commitish
259
260 # mark patch as applied
261 git update-ref "refs/patches/$branch/$pname" HEAD
262
263- rm -f "$TMP_MSG"
264+ rm -f "$TMP_MSG" "$TMP_LOG" "$TMP_PATCH" "$TMP_INFO" "$TMP_PATCH_OUT"
265+
266 )
267 }
268
269@@ -568,7 +693,7 @@ push_patch()
270 bail_action="$2"
271 reject="--reject"
272
273- assert_head_check
274+ head_check "`tail -1 < "$applied" | cut -d: -f 1`"
275 cd_to_toplevel
276
277 # apply the patch if and only if there is something to apply
278@@ -671,7 +796,7 @@ refresh_patch()
279 # incldiffstat
280 __refresh_patch()
281 {
282- assert_head_check
283+ head_check "`tail -1 < "$applied" | cut -d: -f 1`"
284
285 (
286 TMP_DIFF=`get_tmp_file diff`
287@@ -711,6 +836,10 @@ __refresh_patch()
288
289 head -n "-$N" < "$applied" > "$applied.tmp"
290 mv "$applied.tmp" "$applied"
291+
292+ # update the shadow status.
293+ ref=`cat $GIT_DIR/refs/tags/${branch}_top`
294+ echo "$ref:$1" >> $applied_shadow
295 )
296 }
297
298@@ -791,7 +920,12 @@ diffstat=`git config --bool guilt.diffst
299 # The following gets run every time this file is source'd
300 #
301
302-GUILT_DIR="$GIT_DIR/patches"
303+
304+# GUILT_DIR="$GIT_DIR/patches"
305+if [ -z "$GUILT_BASE" ]; then
306+ GUILT_BASE=wrs
307+fi
308+GUILT_DIR="$GUILT_BASE/patches"
309
310 branch=`get_branch`
311
312@@ -814,6 +948,7 @@ fi
313 # very useful files
314 series="$GUILT_DIR/$branch/series"
315 applied="$GUILT_DIR/$branch/status"
316+applied_shadow="$GUILT_DIR/$branch/shadow_status"
317 guards_file="$GUILT_DIR/$branch/guards"
318
319 # determine a pager to use for anything interactive (fall back to more)
diff --git a/meta/recipes-devtools/guilt/files/improve_auto_header_gen.patch b/meta/recipes-devtools/guilt/files/improve_auto_header_gen.patch
deleted file mode 100644
index fa7dd8ae00..0000000000
--- a/meta/recipes-devtools/guilt/files/improve_auto_header_gen.patch
+++ /dev/null
@@ -1,71 +0,0 @@
1guilt: improve the generation of an automatic header
2
3Patches that do not have a proper header are encountered when generating
4a tree. This improves the detection of these patches and generates a sane
5header so the eventual commit will be coherent
6
7Upstream-Status: Inappropriate [oe-specific]
8
9Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
10
11---
12
13 guilt | 24 ++++++++++++++++++------
14 1 file changed, 18 insertions(+), 6 deletions(-)
15
16--- a/guilt
17+++ b/guilt
18@@ -591,7 +591,12 @@ commit()
19 fi
20
21 # last try: make a default commit message if patch doesn't contain one
22- [ ! -s "$TMP_MSG" ] && echo "auto_msg: patch $pname" > "$TMP_MSG"
23+ if [ ! -s "$TMP_MSG" ]; then
24+ echo "auto_msg: importing `basename $pname`" > "$TMP_MSG"
25+ echo "" >> "$TMP_MSG"
26+ echo "This is an automatic import of patch $pname, no headers were" >> "$TMP_MSG"
27+ echo "detected and a default message was constructed" >> "$TMP_MSG"
28+ fi
29
30
31 if [ "$header_type" = "guilt" ]; then
32@@ -599,12 +604,14 @@ commit()
33 # extract a From line from the patch header, and set
34 # GIT_AUTHOR_{NAME,EMAIL}
35 author_str=`sed -n -e '/^From:/ { s/^From: //; p; q }; /^(diff |---)/ q' "$p"`
36- if [ ! -z "$author_str" ]; then
37- GIT_AUTHOR_NAME=`echo $author_str | sed -e 's/ *<.*$//'`
38- export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-" "}"
39- export GIT_AUTHOR_EMAIL="`echo $author_str | sed -e 's/[^<]*//'`"
40+ if [ -z "$author_str" ]; then
41+ author_str="auto commit <unknown@unknown>"
42 fi
43
44+ GIT_AUTHOR_NAME=`echo $author_str | sed -e 's/ *<.*$//'`
45+ export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-" "}"
46+ export GIT_AUTHOR_EMAIL="`echo $author_str | sed -e 's/[^<]*//'`"
47+
48
49 # check in the patch for a subject
50 SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$p")"
51@@ -615,6 +622,11 @@ commit()
52 if [ ${#SUBJECT} -gt 60 ]; then
53 SUBJECT=${SUBJECT: -60}
54 fi
55+
56+ # remove the line from the tmp msg
57+ mv "$TMP_MSG" "$TMP_MSG.work"
58+ cat "$TMP_MSG.work" | grep -v -E ".*$SUBJECT.*" > "$TMP_MSG"
59+ rm "$TMP_MSG.work"
60 fi
61
62 if [ -z "$SUBJECT" ]; then
63@@ -629,7 +641,7 @@ commit()
64
65 SUBJECT=`echo $SUBJECT | sed s'%^ *%%'`
66
67- if [ ! -z "$SUBJECT" ]; then
68+ if [ -n "$SUBJECT" ]; then
69 echo "$SUBJECT" >> $TMP_MSG.subject
70 echo "" >> $TMP_MSG.subject
71 cat "$TMP_MSG" >> $TMP_MSG.subject
diff --git a/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch b/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch
deleted file mode 100644
index c912397e5a..0000000000
--- a/meta/recipes-devtools/guilt/files/make_git_commands_conditional.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1guilt: allow operation outside of git repos
2
3Sometimes guilt is sourced when there isn't a containing git repository.
4Some of the git commands that are always called will report errors
5unecesarility in this scenario. This adds a variable that will inhibit
6those problematic calls
7
8Upstream-Status: Inappropriate [oe-specific]
9
10Signed-off-by <bruce.ashfield@windriver.com>
11
12---
13
14 guilt | 9 ++++++---
15 1 file changed, 6 insertions(+), 3 deletions(-)
16
17
18--- a/guilt
19+++ b/guilt
20@@ -23,7 +23,9 @@ esac
21 # we change directories ourselves
22 SUBDIRECTORY_OK=1
23
24-. "$(git --exec-path)/git-sh-setup"
25+if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then
26+ . "$(git --exec-path)/git-sh-setup"
27+fi
28
29 #
30 # Git version check
31@@ -921,14 +923,15 @@ diffstat=`git config --bool guilt.diffst
32 # The following gets run every time this file is source'd
33 #
34
35-
36 # GUILT_DIR="$GIT_DIR/patches"
37 if [ -z "$GUILT_BASE" ]; then
38 GUILT_BASE=wrs
39 fi
40 GUILT_DIR="$GUILT_BASE/patches"
41
42-branch=`get_branch`
43+if [ -z "$DO_NOT_USE_GITREPO_COMMANDS" ]; then
44+ branch=`get_branch`
45+fi
46
47 # most of the time we want to verify that the repo's branch has been
48 # initialized, but every once in a blue moon (e.g., we want to run guilt-init),
diff --git a/meta/recipes-devtools/guilt/files/optional_head_check.patch b/meta/recipes-devtools/guilt/files/optional_head_check.patch
deleted file mode 100644
index 01e1d026f1..0000000000
--- a/meta/recipes-devtools/guilt/files/optional_head_check.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1guilt: allow guilt-push to opt out of head checking
2
3Depending on the method used to construct a tree, it is entirely
4possible that branches are not only made up of guilt created commits.
5This mixed mode is valid, and in particular is valid when applying
6patches to a tree.
7
8In the default mode of operation, you will see a warning such as
9this when working on a branch:
10
11Expected HEAD commit dbd5861f81a92b8b329561f94b8575c7ee6768b6
12 got 3e8e6f6bd9f1772b91fc1fe9949f541d0560b487
13
14This looks severe, but is harmless during tree construction,
15since even if the HEAD commit was expected, you can still run into
16issues pushing a patch. This is particularly seen when templates are
17adding patches to a kernel.
18
19To make this look less ominous, we make the head check for patch
20pushing opt-in. Which means that by default, you'll no longer see
21this warning if you work with a mixed mode branch during tree
22construction.
23
24Other modes such as pop or refresh can run into problems when
25the HEAD commit isn't tracked or expected, so they should remained
26checked.
27
28Upstream-Status: Inappropriate [oe-specific]
29
30Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
31
32---
33 guilt | 3 +++
34 guilt-push | 3 +++
35 2 files changed, 6 insertions(+)
36
37--- a/guilt
38+++ b/guilt
39@@ -417,6 +417,9 @@ head_check()
40 return 0 ;;
41 esac
42
43+ # If do_head_check isn't set, bail, we are "opt-in"
44+ [ -z "$do_head_check" ] && return 0
45+
46 if [ "`git rev-parse refs/heads/$branch`" != "`git rev-parse $1`" ]; then
47 disp "Expected HEAD commit $1" >&2
48 disp " got `git rev-parse refs/heads/$branch`" >&2
49--- a/guilt-push
50+++ b/guilt-push
51@@ -23,6 +23,9 @@ while [ $# -gt 0 ]; do
52 tag=$2
53 shift
54 ;;
55+ --head_check)
56+ do_head_check=t
57+ ;;
58 *)
59 break
60 ;;
diff --git a/meta/recipes-devtools/guilt/files/uninstall_force.patch b/meta/recipes-devtools/guilt/files/uninstall_force.patch
deleted file mode 100644
index 8f7cea1dec..0000000000
--- a/meta/recipes-devtools/guilt/files/uninstall_force.patch
+++ /dev/null
@@ -1,14 +0,0 @@
1guilt: force removal when uninstalling
2
3Upstream-Status: Inappropriate [oe-specific]
4
5Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
6
7--- a/uninstall.orig
8+++ b/uninstall
9@@ -12,4 +12,4 @@
10
11 shift
12
13-(cd $PRE; rm "$@")
14+(cd $PRE; rm -f "$@")
diff --git a/meta/recipes-devtools/guilt/guilt-native_0.33.bb b/meta/recipes-devtools/guilt/guilt-native_0.33.bb
deleted file mode 100644
index d4dd616d72..0000000000
--- a/meta/recipes-devtools/guilt/guilt-native_0.33.bb
+++ /dev/null
@@ -1,35 +0,0 @@
1DESCRIPTION = "guilt is quilt like tool for git"
2LICENSE = "GPLv2"
3
4LIC_FILES_CHKSUM = "file://COPYING;md5=b6f3400dc1a01cebafe8a52b3f344135"
5
6PV = "0.33"
7PR = "r4"
8
9inherit native
10
11SRC_URI = "http://ftp.de.debian.org/debian/pool/main/g/guilt/guilt_${PV}.orig.tar.gz\
12 file://guilt-push.patch \
13 file://guilt-pop.patch \
14 file://guilt.patch \
15 file://guilt-init.patch \
16 file://guilt-import-commit.patch \
17 file://uninstall_force.patch \
18 file://guilt-push-no-series.patch \
19 file://make_git_commands_conditional.patch \
20 file://improve_auto_header_gen.patch \
21 file://guilt-bash.patch \
22 file://guilt-update-supported-git-versions-to-1.8.x.patch \
23 file://optional_head_check.patch"
24
25SRC_URI[md5sum] = "d800c5e0743d90543ef51d797a626e09"
26SRC_URI[sha256sum] = "64dfe6af1e924030f71163f3aa12cd846c80901d6ff8ef267ea35bb0752b4ba9"
27
28# we don't compile, we just install
29do_compile() {
30 :
31}
32
33do_install() {
34 oe_runmake PREFIX=${D}/${prefix} install
35}
diff --git a/meta/recipes-devtools/guilt/guilt-native_git.bb b/meta/recipes-devtools/guilt/guilt-native_git.bb
new file mode 100644
index 0000000000..9c75c3c970
--- /dev/null
+++ b/meta/recipes-devtools/guilt/guilt-native_git.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "guilt is quilt like tool for git"
2LICENSE = "GPLv2"
3
4LIC_FILES_CHKSUM = "file://COPYING;md5=b6f3400dc1a01cebafe8a52b3f344135"
5
6inherit native
7
8SRC_URI = "git://repo.or.cz/guilt.git \
9 file://guilt-bash.patch \
10 "
11
12SRCREV="c2a5bae511c6d5354aa4e1cb59069c31df2b8eeb"
13
14S="${WORKDIR}/git"
15
16SRC_URI[md5sum] = "d800c5e0743d90543ef51d797a626e09"
17SRC_URI[sha256sum] = "64dfe6af1e924030f71163f3aa12cd846c80901d6ff8ef267ea35bb0752b4ba9"
18
19# we don't compile, we just install
20do_compile() {
21 :
22}
23
24do_install() {
25 oe_runmake PREFIX=${D}/${prefix} install
26}