GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Merging from upstream Vim Merging from upstream Vim
Yee Cheng Chin edited this page
MacVim is a fork of Vim in order to provide a GUI, and as such it routinely needs to merge from upstream. The process is not completely trivial as MacVim is an intrusive fork, in that it doesn't simply wraps a Vim executable in a GUI with minimal change, but instead has source code changes sprinkled all over Vim. There are a few reasons for that, but in particular:
Note: Merging from upstream is usually done by the code maintainers. This is necessary because each merge is usually an involved process and requires going through a lot of files/merge conflicts, and isn't very conductive to a pull-request model that are hard to properly review. Please do not file a pull request to merge from upstream. If you notice that MacVim hasn't merged from upstream in a while (2-3 weeks), file an issue. To merge from upstream, add both the Vim (use the remote name MacVim's master branch is protected behind branch protection which requires status checks to have passed before you are allowed to push commits to it or merge PRs. While it's possible for a maintainer to override that by directly pushing new commits to master, the normal procedure is to first push the new merge commit to a "staging" branch first, and let CI checks run to completion. Once CI has passed for that branch, push the same commit to master branch. There should be no GitHub warnings about overriding branch protection rules if staging has passed CI with said commit. This makes sure that we only push tested commits to master branch and prevents breakage. While it's possible to set up a CI step to automatically merge from staging once CI has passed, generally we prefer to have read-only CI for security reasons, and so we do this step manually for now. Some merges will result in merge conflicts and need some cleanups. Some caveats to pay attention to:
It's also sometimes easier to merge small amounts of Vim commits one at a time (e.g. 100-200 commits) instead of all at once if MacVim is a little behind. GitHub allows commits to automatically close issues via the "close #XXXX" markers in commit messages. Unfortunately, this feature is not configurable at all as of this writing and cannot be turned off. If upstream Vim used this to close an issue, it would be referring to an issue in Vim, but the moment we merge the commit and push to GitHub will try to close a random unrelated issue of the same number in MacVim as well. There is no easy way to work around this issue, because we don't want to rewrite Vim's history to remove the issue markers (as that will change the commit hash). After you have pushed a merge, you should visit https://github.com/macvim-dev/macvim/issues?q=sort%3Aupdated-desc+ to see if there are any recently updated issues, and if some issues were accidentally closed, just go and manually re-open. Usually, Vim issue numbers are much larger than MacVim issue numbers and we will be fine. You could manually check what issues are referenced when doing an upstream merge by doing the following: Then compare that with the largest issue number in MacVim: If the referenced issues are all larger than MacVim's largest issue number, then we will be fine. See https://github.com/orgs/community/discussions/17308 Interesting changes in Vim should be included in MacVim release notes for users who don't pay close attention to Vim development to be able to tell what changed. Generally, features and important bug fixes should be included. It's also useful to mention most newly included options, commands, functions, color schemes, and bundled plugins. The list of new options, commands, and functions can be obtained by diff'ing Long term, MacVim should try to minimize the change from Vim, to make each merge easier and less error-prone. As of this writing (2020-01-14) there are ~2000 lines of diff for all of Vim's C code (
Suggestions are welcome for improvements to make the code easier to merge and maintain. Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |