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: merging_strategy.md
+96-19Lines changed: 96 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,59 +44,136 @@ To make things clear, will start from a blank state. You can skip steps you've a
44
44
git pull
45
45
```
46
46
47
-
2.**Rebase onto new upstream tag** (e.g., b6789):
47
+
2.**Tag the branch if no existing tag yet**:
48
48
```bash
49
-
git rebase b6789
49
+
git tag v6469.1.2
50
+
git push tether tag v6469.1.2
50
51
```
51
52
52
-
3.**Resolve conflicts**: Git will stop if it finds conflicts. Resolve them as appropriate (may need to check with original writers)
53
+
REVIEW AND DECIDE: The following step combines all commits since the last rebase to minimize manual resolution of conflicts. This makes sure that any related changes and/or reverts are only applied once, resulting in a more direct and simple rebase process. The disadvantage of this process is that individual commits are lost and replaced by one big commit message instead.
53
54
54
-
4.**Push rebased changes**:
55
+
3.**Squash all commits since the last rebase**:
55
56
```bash
56
-
git push -f
57
+
# get all commits since current branch diverged with the upstream updates (b7028 in this case)
58
+
git log $(git merge-base HEAD b7028)..HEAD > commit_messages.txt
59
+
60
+
# combine all commits into a single one and aggregate all commit messages
61
+
git reset --soft $(git merge-base HEAD b7028)
62
+
git commit -F commit_messages.txt
57
63
```
58
64
59
-
5.**Create and push new tag**:
65
+
4.**Rebase onto new upstream tag** (e.g., b7028):
60
66
```bash
61
-
git tag b6789.0.0
62
-
# Add description like "Sync with upstream version b6789"
63
-
git push tether tag b6789.0.0
67
+
git rebase b7028
64
68
```
65
69
66
-
6.**Test and publish**: Test the new tag, and if it works properly, publish to vcpkg
70
+
5.**Resolve conflicts** Git will stop if it finds conflicts. Resolve them as appropriate (may need to check with original writers). To assist with the conflict resolution process, it is better and recommended to have the common ancestor’s code viewable for better context. Set with the following git config:
71
+
```bash
72
+
git config --global merge.conflictstyle diff3
73
+
```
74
+
75
+
A conflict would now look like this:
76
+
```bash
77
+
<<<<<<< current
78
+
/* the current ggml upstream changes */
79
+
||||||| base
80
+
/* the original code from the common ancestor */
81
+
=======
82
+
/* incoming tether custom changes */
83
+
>>>>>>> incoming
84
+
```
85
+
86
+
6.**Push rebased changes to forked repo**:
87
+
```bash
88
+
# safer than git push -f
89
+
git push origin --force-with-lease
90
+
```
91
+
92
+
7.**Create and push new tag**:
93
+
```bash
94
+
# add description like "Sync with upstream version b7028"
95
+
git tag -a v7028.0.0 -m "Sync with upstream version b7028"
96
+
git push origin tag v7028.0.0
97
+
```
98
+
99
+
8.**Test and publish**: Test the new tag.
67
100
68
101
#### Testing Process
69
102
70
-
1.**Get test project**: Download the test project from [vcpkg-test-llama-cpp](https://drive.google.com/file/d/1Fm47_QsPsjp-kjPnQpQiRTE5KIrxMh_G/view?usp=sharing) (simple project that depends on the llama-cpp port)
103
+
1.**Get and extract test project**: Download the test project from [vcpkg-test-llama-cpp](https://drive.google.com/file/d/1Fm47_QsPsjp-kjPnQpQiRTE5KIrxMh_G/view?usp=sharing) (simple project that depends on the llama-cpp port)
104
+
105
+
2.**Fork the qvac registry**: Fork `qvac-registry-vcpkg` repo in GitHub
0 commit comments