You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-8Lines changed: 38 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,44 @@ This is a fork of the excellent [`fuser`](https://github.com/cberner/fuser) Rust
6
6
7
7
This fork should be maintained in the `fuser/fork` branch of the [awslabs/mountpoint-s3 repository on GitHub](https://github.com/awslabs/mountpoint-s3/tree/main/vendor/fuser).
8
8
9
-
To pull in new changes from upstream, you should fetch and rebase the changes locally and then force push to the `fuser/fork` branch (- not ideal!).
10
-
Once the `fuser/fork` branch is as desired, create a new branch from Mountpoint's `main` branch.
11
-
Run the [`vendor-fuser.sh` script](https://github.com/awslabs/mountpoint-s3/blob/main/vendor-fuser.sh).
12
-
You should open a pull request with the new commit created by the script.
13
-
This pull request is where the changes are reviewed.
14
-
15
-
If you wish to add new divergent changes to this fork of Fuser,
16
-
open a pull request on the Mountpoint repository branching from the `fuser/fork` branch and use `fuser/fork` as the base branch when creating the pull request.
9
+
#### Sync with the origin
10
+
11
+
To pull in new changes from upstream, you should fetch changes from the original upstream and rebase them locally.
12
+
13
+
1. Add a new remote if haven't done it already `git remote add fuser https://github.com/cberner/fuser.git`
14
+
2. Fetch from the remote `git fetch fuser`
15
+
3. List all the FUSER's tags `git tag -l | grep v`, it'll output all of the FUSER versions like `v0.15.1`. Select the version that you'd want to sync with (latest one by default)
16
+
4.**Important** Next step implies history change, so at this point we need to make sure that we have a snapshot of the current state of `fuser/fork` branch. It must be a tag, e.g. `fuser-fork-<version>` containing the head commit. We assume we have it since we supposed to be following this runbook during the previous sync.
17
+
1. Create a new branch from `fuser/fork`, `git rebase v0.15.1 -i` there and pick our commits which we'd like to put on top of the target tag (all of the commits by default)
18
+
2. Once rebase is finished and all the possible conflicts (at least in `Cargo.toml`) are solved bump the fork's version and commit the change. Original version is not equal to fork's version, but we have to bump either major or patch part of it depending on what's changed in the original
19
+
5. We might want to create a "read-only" PR from the rebased branch with `awslabs:fuser/fork` as the base branch. This PR should never get merged as it'll produce a new commit, but this is a good way for us to have a collaborative consensus on what we're pulling in. After the PR is reviewed it needs to be closed
20
+
> *Note* If we're sure what we're doing the PR step can be skipped and we can force push rebased branch into `fuser/fork`
21
+
6. After PR is approved or changes pushed directly to `awslabs:fuser/fork` we need to create a tag for persisting the branch history.
22
+
1. Create a new tag with descriptive name containing the currently used fork version, e.g `git tag fuser-fork-0.2.0`.
23
+
2. Push the created tag to remote `git push upstream fuser-fork-0.2.0`.
24
+
3. Make sure it's there `git ls-remote --tags upstream "refs/tags/fuser-fork-0.2.0"`.
25
+
It should produce something like `bc31e4d2c2f4601d51b9f0ec37159ee515280253 refs/tags/fuser-fork-0.2.0`
26
+
7. Once `fuser/fork` is in the desired state and the tag is ready we can consume the change in the `main` branch
27
+
1.`git checkout main`
28
+
2. Pull in the changes from upstream including submodules `git pull upstream main --recurse-submodules` and update the submodule `git submodule update --remote mountpoint-s3-fuser`.
29
+
> We can avoid adding `--recurse-submodules` argument all the time by telling git to update submodules on every pull `git config set submodule.recurse true`
30
+
31
+
1. Since we changed the `fuser/fork` branch and `mountpoint-s3-fuser` refers to it submodule update should produce changes in `mountpoint-s3-fuser` index as well as in `Cargo.lock` if fork's version was changed. We need to commit these changes
32
+
2. Make sure that everything works by running tests and/or other checks and create a PR to `main` branch
33
+
3. Get the PR merged
34
+
35
+
36
+
#### PR to `fuser/fork`
37
+
38
+
Create a new branch from `fuser/fork`, commit changes and create a PR with `awslabs:fuser/fork` as the base branch.
39
+
40
+
The checks for this PR will be broken as they run against the `main` branch which has different structure (this is a point for improvement), but we still can have a consensus on what we're pulling in.
41
+
After PR is reviewed it needs to be closed (as will don't want to further modify the history via GitHub Merge) and the commit needs to be cherry-picked on top of `fuser/fork` branch `git cherry-pick -m 1 <commit-hash>`
42
+
43
+
After that we can push the updated local `fuser/fork` branch to remote.
44
+
45
+
#### Publishing the fork
46
+
We want to treat the fork as a standard crate inside our project and follow the existing [manual](https://github.com/awslabs/mountpoint-s3/blob/main/mountpoint-s3-client/PUBLISHING_CRATES.md) for publishing.
0 commit comments