aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>2017-04-07 01:31:39 +0300
committerJustin M. Keyes <justinkz@gmail.com>2017-04-19 04:03:09 +0200
commit29ab8c1ae2b6a13f11f80c9485fa2720f3365b8b (patch)
tree45be928f79ccd3e873d846bb6cd7ef9518329b7b
parent440133e0d5d576e46bd5ffa555f6a9c534789b48 (diff)
downloadrneovim-29ab8c1ae2b6a13f11f80c9485fa2720f3365b8b.tar.gz
rneovim-29ab8c1ae2b6a13f11f80c9485fa2720f3365b8b.tar.bz2
rneovim-29ab8c1ae2b6a13f11f80c9485fa2720f3365b8b.zip
doc/CONTRIBUTING.md: Recommend merge-based workflow.
References #6435
-rw-r--r--CONTRIBUTING.md22
1 files changed, 16 insertions, 6 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f7389ece75..52584c25d8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,12 +31,22 @@ Pull requests ("PRs")
- Avoid cosmetic changes to unrelated files in the same commit: extra noise
makes reviews more difficult.
- Use a [feature branch][git-feature-branch] instead of the master branch.
-- [Rebase your feature branch][git-rebasing] onto (upstream) master before
- opening the PR.
-- After addressing the review comments, it's fine to rebase and force-push to
- your review.
-- Try to [tidy your history][git-history-rewriting]: combine related commits
- with interactive rebasing, separate monolithic commits, etc.
+- Edit history with `ri` alias: add
+
+ [alias]
+ ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -"
+
+ to your `~/.gitconfig`.
+
+ This avoids unnecessary rebases yet still allows you to combine related
+ commits, separate monolithic commits, etc.
+- Rebase relatively small PRs, using `exec make -C build unittest` after
+ each pick/edit/reword, after all following squash/fixup.
+- Merge in `master` of bigger PRs. Do not do excessive merging: merge
+ in case of merge conflicts or when master introduces changes which break
+ your PR.
+
+ Do not edit commits which come before the merge commit.
### Stages: WIP, RFC, RDY