Merge ../repo.or.cz into stuff
[vim_extended.git] / git-merge-vim-runtime.sh
blobcce8b79f5059757d1e1f5b70fa1dacccf6f4e672
1 #!/bin/sh
3 # by Markus Heidelberg, 2008
4 # based on git-merge-one-file.sh from the git suite, which is
5 # Copyright (c) Linus Torvalds, 2005
7 # This is a wrapper around git-merge-one-file to handle the initial merge of
8 # the current runtime files from the editor Vim into Vim's source tree. It's
9 # called from git-merge-index with
11 # $1 - original file SHA1 (or empty) - Vim sources
12 # $2 - file in branch1 SHA1 (or empty) - Vim sources
13 # $3 - file in branch2 SHA1 (or empty) - Vim runtime
14 # $4 - pathname in repository
15 # $5 - original file mode (or empty) - Vim sources
16 # $6 - file in branch1 mode (or empty) - Vim sources
17 # $7 - file in branch2 mode (or empty) - Vim runtime
19 # Since we use the same revision (HEAD of Vim sources) for the 'base' and 'our'
20 # tree in git-read-tree, $1 is always equal to $2, therefore unchanged.
22 case "${1:-.}${2:-.}${3:-.}" in
24 # Deleted (not available) in branch2 (Vim runtime) and unchanged available in
25 # the others (Vim sources).
26 # Currently (Vim 7.2) affected are the files
27 # * outside of runtime/
28 # * in runtime/icons/
29 # * in runtime/ with the pattern *.info
30 # because these are not available in the Vim runtime branch.
32 "$1$1.")
33 # git-merge-one-file would delete the file, but we want to keep it in
34 # our special case. Only print out the handled files below runtime/
35 expr "$4" : 'runtime/.*' > /dev/null &&
36 echo "handled and kept by $(basename $0): $4"
37 exec git update-index --add --cacheinfo "$6" "$2" "$4"
41 # All the other cases
43 # Added (only available) in branch2 (Vim runtime) and not available in the
44 # others (Vim sources) -> ..$3
45 # Or available (may be modified) in branch2 (Vim runtime) and unchanged
46 # available in the others (Vim sources) -> $1$1$3
48 #"..$3" | "$1$1$3")
50 # run the standard handler
51 exec git merge-one-file "$1" "$2" "$3" "$4" "$5" "$6" "$7"
53 esac
54 exit 1