vim_mainline and vim_extended are discontinued
[vim_extended.git] / git-merge-vim-messages.sh
bloba5a1df44001791ce4aa63afca2a06eb27454dd67
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 message 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 messages
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 messages
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 messages) and unchanged available in
25 # the others (Vim sources).
26 # Currently (Vim 7.2) affected are the files
27 # * outside of src/po/
28 # * src/po/check.vim
29 # because these are not available in the Vim messages branch.
31 "$1$1.")
32 # git-merge-one-file would delete the file, but we want to keep it in
33 # our special case. Only print out the handled files below src/po/
34 expr "$4" : 'src/po/.*' > /dev/null &&
35 echo "handled and kept by $(basename $0): $4"
36 exec git update-index --add --cacheinfo "$6" "$2" "$4"
40 # All the other cases
42 # Added (only available) in branch2 (Vim messages) and not available in the
43 # others (Vim sources) -> ..$3
44 # Currently (Vim 7.2) affected are the files
45 # * src/po/main.aap
46 # because these are only available in the Vim messages branch.
48 # Or available (may be modified) in branch2 (Vim messages) and unchanged
49 # available in the others (Vim sources) -> $1$1$3
51 #"..$3" | "$1$1$3")
53 # run the standard handler
54 exec git merge-one-file "$1" "$2" "$3" "$4" "$5" "$6" "$7"
56 esac
57 exit 1