DNNCommunity / DNNCommunity/DNNDocs
RFC: Merging Changes Across DNN Versions
- Dominant language
- CSS
- Stars
- 24
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
The question is how do we handle a situation where the current version of the docs is for DNN 10. We've already released and have branches for DNN 8 and DNN 9. A change is made to a topic that applies to DNN 8-10. How do we handle getting that change in the DNN 8 branch merged into the DNN 9 and DNN 10 branches.
I think our best option is to use **cherry picking**. This a `git` command that allows us to take a specific commit in one branch and copy it into another branch. Its use is discouraged in development scenarios primarily because you are creating a copy of the changes in the commit and making a new commit on the new branch with those changes. In a development scenario, this isn't idea. because you lose the history of the original commit. However, this isn't a development scenario. We don't need to track changes to the content across time over all branches.
In order to do this, we should adopt a policy of 1 commit per file, unless the same change is made across multiple topics. Since cherry picking works with commits, the more granular we can make those commits, the easier it will be to get just the content we want. Plus, you can cherry pick multiple commits in one command.
## How Cherry Picking Works
Let's say we have a master branch with the current DNN version (say, DNN10) and have a branch for DNN8 and DNN9. We'll call these branches: `dnn10` `dnn9` `dnn8` and `master` (which contains the current release of the docs, regardless of DNN version). Let's also assume that changes were made to a topic in the `dnn8` branch that should also apply to `dnn9` and `dnn10`.
### Step One: Get the Hash of the Source Commit
The first thing we need to do is identify the specific commit(s) we want to merge.
```
git checkout dnn8
```
```
git log --oneline
5dfe882 Changed File Title to Creating Users
12dc37f Added Creating Portal topic
```
For this example, we'll use `5dfe882`
### Step Two: Switch to the Target Branch
```
git checkout dnn9
```
### Step Three: Do the Cherry Pick
```
git cherry-pick 5dfe882
```
You can pull in multiple commits by simply adding them to the command:
```
git cherry-pick 5dfe992 12dc37f
```
### Step Four: Push your Changes
```
git push
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.