Skip to content

Commit 6bbc995

Browse files
committed
Update CONTRIBUTING.md
1 parent 85ce51c commit 6bbc995

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

‎docs/CONTRIBUTING.md‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,57 @@ https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contr
66

77
# Contributing
88

9+
## Rbenv Tags Git Configuration
10+
11+
Many repositories in the nodenv organization are forks from the rbenv
12+
ecosystem. To support pulling changes from the upstream rbenv repository into
13+
nodenv, it is necessary to add rbenv as a Git remote. However, this adds some
14+
complication because (by default), Git tags for nodenv and rbenv will collide.
15+
(ie, rbenv's `v1.0.0` tag conflicts with nodenv's `v1.0.0`) Additionally,
16+
having rbenv's tags exist locally introduces complications to the release
17+
process: `git push --follow-tags` would push rbenv's tags to nodenv's `origin`
18+
remote.
19+
20+
The following special Git configuration avoids these and other headaches while
21+
still allowing `origin` to be pushed using `--tags` or `--follow-tags`
22+
options—without the risk of pushing rbenv's tags into nodenv's tagspace. The
23+
configuration assumes nodenv's remote is `origin`, and rbenv's remote is
24+
`rbenv`.
25+
26+
1. Configure rbenv to not fetch tags by default:
27+
```console
28+
git config remote.rbenv.tagOpt --no-tags
29+
```
30+
31+
2. Fetch rbenv's tags to their own refspec namespace (`rbtags`, in this case):
32+
```console
33+
git config --add remote.rbenv.fetch '+refs/tags/*:refs/rbtags/*'
34+
```
35+
36+
> [!WARNING]
37+
> The `--tags` option to `fetch` et. al. will override this setting.
38+
39+
Resulting snippet in `.git/config`:
40+
41+
```gitconfig
42+
[remote "origin"]
43+
url = git@github.com:nodenv/nodenv.git
44+
fetch = +refs/heads/*:refs/remotes/origin/*
45+
[remote "rbenv"]
46+
url = git@github.com:rbenv/rbenv.git
47+
fetch = +refs/heads/*:refs/remotes/rbenv/*
48+
fetch = +refs/tags/*:refs/rbtags/*
49+
tagopt = --no-tags
50+
```
51+
52+
To reference rbenv's tags, use the fully qualified refspec: `refs/rbtags/vX.Y.Z`
53+
54+
```console
55+
git show refs/rbtags/v1.1.2
56+
git checkout refs/rbtags/v1.1.2
57+
git merge refs/rbtags/v1.1.2
58+
```
59+
960
## Releasing
1061

1162
From a clean working copy, run `npm version major|minor|patch|VERSION`.

0 commit comments

Comments
 (0)