summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/guilt/files/guilt-import-commit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/guilt/files/guilt-import-commit.patch')
-rw-r--r--meta/recipes-devtools/guilt/files/guilt-import-commit.patch96
1 files changed, 0 insertions, 96 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