File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 5
5
# Usage:
6
6
#
7
7
# $ cd /path/to/llama.cpp
8
- # $ ./scripts/sync-ggml-am.sh -skip hash0,hash1,hash2...
8
+ # $ ./scripts/sync-ggml-am.sh -skip hash0,hash1,hash2... -C 3
9
9
#
10
10
11
11
set -e
@@ -25,9 +25,23 @@ lc=$(cat $SRC_LLAMA/scripts/sync-ggml.last)
25
25
echo " Syncing ggml changes since commit $lc "
26
26
27
27
to_skip=" "
28
- if [ " $1 " == " -skip" ]; then
29
- to_skip=$2
30
- fi
28
+
29
+ # context for git patches in number of lines
30
+ ctx=" 8"
31
+
32
+ while [ " $1 " != " " ]; do
33
+ case $1 in
34
+ -skip )
35
+ shift
36
+ to_skip=$1
37
+ ;;
38
+ -C )
39
+ shift
40
+ ctx=$1
41
+ ;;
42
+ esac
43
+ shift
44
+ done
31
45
32
46
cd $SRC_GGML
33
47
@@ -52,7 +66,7 @@ while read c; do
52
66
fi
53
67
fi
54
68
55
- git format-patch -k $c ~1..$c --stdout -- \
69
+ git format-patch -U ${ctx} - k $c ~1..$c --stdout -- \
56
70
CMakeLists.txt \
57
71
src/CMakeLists.txt \
58
72
cmake/FindSIMD.cmake \
@@ -191,7 +205,7 @@ if [ -f $SRC_LLAMA/ggml-src.patch ]; then
191
205
> ggml-src.patch.tmp
192
206
mv ggml-src.patch.tmp ggml-src.patch
193
207
194
- git am ggml-src.patch
208
+ git am -C ${ctx} ggml-src.patch
195
209
196
210
rm -v $SRC_LLAMA /ggml-src.patch
197
211
fi
You can’t perform that action at this time.
0 commit comments