update-vim-runtime: take Bram as author and committer
[vim_extended.git] / README_gitrepo.txt
blob446c023fa6c7bc60a1e6d6e8bc6e7c3922c5bc70
1 General information
2 ===================
4 This README describes the usage of two git repositories for Vim. Since they
5 are related and hence the proceeding often overlaps, it makes sense to keep
6 them documented in a common README file. Furthermore they have the same
7 maintainer.
9 Although this file is meant to be readable in plain text, for consistency
10 regarding the formatting it was written keeping AsciiDoc syntax in mind.
11 Because of this it is now possible to convert it to HTML with a few errors,
12 which don't seem to affect the output:
14         $ asciidoc -o readme_gitrepo.htm README_gitrepo.txt
16 Maintainer: Markus Heidelberg <markus.heidelberg@web.de>
19 Vim mainline
20 ------------
22 This is a git repository of the official Vim sources from vim.org.
23 Additionally it offers a branch including merely the latest runtime files,
24 which can be merged into the source tree. For convenience the resulting tree
25 is already available as a separate branch.
27 http://repo.or.cz/w/vim_mainline.git
30 Vim extended
31 ------------
33 This is a git repository, which is meant to be an extension to the official
34 Vim from vim.org. It includes various extensions and features that didn't yet
35 get into the official version or even won't ever. Most features had been sent
36 as patches to the Vim mailing list.
38 See also the `Vim patches` site:
39 http://groups.google.com/group/vim_dev/web/vim-patches
41 Please note that there is no official support for this from Bram. The patches
42 will most likely work and they appear to do so for several people. However,
43 you might get unlucky and stuff breaks. At worst, you could lose your data.
44 So please be aware of this before going down this road.
46 http://repo.or.cz/w/vim_extended.git
49 Basic use
50 =========
52 Git tips
53 --------
55 This will only cover some helpful commands/settings, which you probably don't
56 see while getting started with git. Still, you should read the docs if you
57 want to work with git.
59 Enable colors:
61         $ git config --global color.ui auto
63 Set your favorite merge tool for use with `git-mergetool`:
65         $ git config --global merge.tool vimdiff
66         $ git config --global merge.tool gvimdiff
68 List all branches (remote and local):
70         $ git branch -a
73 The 'master' branch
74 -------------------
76 The master branch contains the latest runtime files and, at the time of this
77 writing, each feature branch for vim_extended. This may change if features
78 under active development are included in this repository.
80 Get the whole repository over the git or HTTP protocol:
82         $ git clone git://repo.or.cz/vim_mainline.git
83         $ git clone http://repo.or.cz/r/vim_mainline.git
85         $ git clone git://repo.or.cz/vim_extended.git
86         $ git clone http://repo.or.cz/r/vim_extended.git
88 Enter the cloned and checked out repository:
90         $ cd vim_mainline
92         $ cd vim_extended
94 Edit, build and install as usual:
96         $ vim; make; make install
98 Get updates from the repository:
100         $ git pull
103 Advanced use
104 ============
106 Normally, you don't need anything from this part of the README as you already
107 have the full functionality of vim_extended resp. vim_mainline when using the
108 'master' branch as described in "Basic use" above. In case you have problems
109 with specific features, if a feature isn't merged into 'master' or if you
110 simply are interested in mixing your own Vim this section is for you.
113 Creating a custom branch (vim_extended)
114 ---------------------------------------
116 Create and check out your own custom branch 'custom',
117 based von 'vim' or 'vim-with-runtime':
119         $ git checkout -b custom origin/vim
121         $ git checkout -b custom origin/vim-with-runtime
123 Merge the feature branches you'd like to use:
125         $ git merge origin/feat/rel-line-numbers
126         $ git merge origin/feat/float-point-ext
128 NOTE: Don't merge multiple branches at the same time (octopus merge strategy).
129       This may work without problems, but appearing conflicts cannot be solved
130       without significant effort.
132 So do *NOT* do this:
134         $ git merge origin/feat/rel-line-numbers origin/feat/float-point-ext
136 After the merge, solve possible conflicts by hand or with `git-mergetool`
137 which opens 3 windows with the base, local and remote version of the file:
139         $ git mergetool
141 If more than one feature has filled the extra_patches[] array from
142 src/version.c, merge conflicts will arise. These are trivial to solve by
143 concatenating the various description lines and won't arise a second time when
144 merging these branches again.
147 Merging the 'vim-runtime' branch
148 --------------------------------
150 To merge the 'vim-runtime' branch, which contains the latest runtime files,
151 into your custom branch yourself, you have to follow a special procedure.
152 Because 'vim-runtime' and 'vim' don't have a common ancestor, you can't simply
153 merge the 'vim-runtime' branch like the feature branches. That would only be
154 possible if the runtime/ directory of 'vim' was empty, more exactly: if it
155 doesn't include conflicting paths (equal filenames).
157 Basically, what you have to do initially is to artificially create a common
158 ancestor and then merge the runtime files from 'vim' and 'vim-runtime':
160 <1> Merge 'vim-runtime' without modifying the runtime files, neither in the
161     index, nor in the working tree.
163         $ git merge -s ours --no-commit origin/vim-runtime
164         Automatic merge went well; stopped before committing as requested
166 <2> Perform a 3-way merge with the current 'HEAD' as `base` and `local` branch
167     and 'vim-runtime' as `remote` branch. Update the working tree after the
168     merge has processed the index. All the files only available in 'vim' are
169     in `unmerged` state afterwards, all the files only available or modified
170     in 'vim-runtime' in `new file` resp. `modified` state. You can verify this
171     with `git-status`.
172     Normally the runtime files of the 'vim-runtime' branch (from rsync) are
173     always newer than the runtime files of the 'vim' branch. If this is not
174     the case, e.g. the latest runtime files are not yet updated after an
175     official patch containing runtime changes, this command will overwrite the
176     changes the patch introduces and use the older files from 'vim-runtime'.
177     But as soon as the changes are available in 'vim-runtime', your custom
178     branch that merged the runtime branch will always contain the latest
179     files, whether they are introduced with the official patches or the latest
180     runtime files.
181     Using 'HEAD' both for `base` and `local` branch also helps with
182     circumventing merge conflicts.
183     So this may only be a little problem when starting your custom runtime
184     merge, but it's the easiest solution to merge the runtime files without
185     getting frustrated by merge conflicts.
187         $ git read-tree -u -m HEAD HEAD origin/vim-runtime
189 <3> Merge the files that are in `unmerged` state. Since git thinks the
190     unmerged files are deleted in 'vim-runtime', we have to use a custom merge
191     program `git-merge-vim-runtime.sh`. This will prevent the merge process
192     from deleting the files only available in the 'vim' branch and
193     additionally output a message for every file that is affected. This has
194     the drawback that files which are actually deleted in 'vim-runtime' and
195     not just unavailable aren't deleted in the result of the initial merge.
196     This should only be a small problem compared to the gain of the ease of
197     the automatic merge.
198     After these steps, there should be no unmerged files left, any more.
200         $ git merge-index git-merge-vim-runtime.sh -a
201         handled and kept by git-merge-vim-runtime.sh: runtime/doc.info
202         [...]
204 <4> Record the result to the repository, this creates a merge commit.
206         $ git commit
208 All the following merges just need this ordinary command:
210         $ git merge origin/vim-runtime
213 There is a merge strategy `subtree` which was tried first, but it caused some
214 problems:
216 * The runtime/ directory wasn't empty, so using `git-read-tree` with 1 tree as
217   described in howto/using-merge-subtree.txt didn't work.
219 * The options `-m` and `--prefix=runtime/` of `git-read-tree` are mutually
220   exclusive, so this attempt didn't work.
222 And it didn't offer advantages, but rather disadvantages:
224 * You have overhead due to copying files from ./runtime/ to ./ and vice versa
225   when switching branches.
227 * You have to remember using `git-merge` with the `-s subtree` option
228   everytime you merge 'vim-runtime'.
230 * It's simply not necessary. Since the runtime files don't belong to another
231   project, but to Vim, we have the freedom to save the runtime files in the
232   runtime/ subdirectory.
235 Creating a custom runtime branch
236 --------------------------------
238 You can also create your custom runtime branch from scratch, without the use
239 of the provided 'vim-runtime' branch.
241 Set the current HEAD to a new, not yet existing branch:
243         $ git symbolic-ref HEAD refs/heads/custom-runtime
245 Remove/unstage all files from the index:
247         $ git rm --cached -r .
249 Remove all files from the working directory:
251         $ git clean -f -d -x
253 Now you can add the runtime files and do your initial commit. This will also
254 create the branch 'custom-runtime'.
257 Getting the latest runtime files
258 --------------------------------
260 The latest runtime files in the 'vim-runtime' branch are fetched via rsync
261 with the following command:
263         $ rsync -avzcP --delete \
264                 --exclude="/dos/" \
265                 --include="/spell/en.*.spl" \
266                 --exclude="/spell/*.spl" \
267                 --include="/spell/en.*.sug" \
268                 --exclude="/spell/*.sug" \
269                 ftp.nluug.nl::Vim/runtime/ runtime
271 Therefore, a script is available in the 'stuff' branch, which automatically
272 commits and shows the changes after updating. You don't even have to save the
273 script but can just use this commmand:
275         $ git show origin/stuff:update-vim-runtime.sh | sh
277 ////////////////
278 vim: ft=asciidoc
279 ////////////////