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 55# Usage:
66#
77# $ 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
99#
1010
1111set -e
@@ -25,9 +25,23 @@ lc=$(cat $SRC_LLAMA/scripts/sync-ggml.last)
2525echo " Syncing ggml changes since commit $lc "
2626
2727to_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
3145
3246cd $SRC_GGML
3347
@@ -52,7 +66,7 @@ while read c; do
5266 fi
5367 fi
5468
55- git format-patch -k $c ~1..$c --stdout -- \
69+ git format-patch -U ${ctx} - k $c ~1..$c --stdout -- \
5670 CMakeLists.txt \
5771 src/CMakeLists.txt \
5872 cmake/FindSIMD.cmake \
@@ -191,7 +205,7 @@ if [ -f $SRC_LLAMA/ggml-src.patch ]; then
191205 > ggml-src.patch.tmp
192206 mv ggml-src.patch.tmp ggml-src.patch
193207
194- git am ggml-src.patch
208+ git am -C ${ctx} ggml-src.patch
195209
196210 rm -v $SRC_LLAMA /ggml-src.patch
197211fi
You can’t perform that action at this time.
0 commit comments