Skip to content

Switch to git subtree for lib/vscode instead of a submodule #1587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nhooyr opened this issue May 1, 2020 · 5 comments
Closed

Switch to git subtree for lib/vscode instead of a submodule #1587

nhooyr opened this issue May 1, 2020 · 5 comments
Assignees
Labels
enhancement Some improvement that isn't a feature
Milestone

Comments

@nhooyr
Copy link
Contributor

nhooyr commented May 1, 2020

Our patch is massive, a subtree would be a better option at this point.

Discussed and approved by @code-asher

@nhooyr nhooyr added the enhancement Some improvement that isn't a feature label May 1, 2020
@nhooyr nhooyr self-assigned this May 1, 2020
@nhooyr
Copy link
Contributor Author

nhooyr commented Jun 3, 2020

Viewing on GitHub would make it hard to see what changed from vanilla VS Code but it'd be easy to see what additional changes we've made.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 30, 2020

Also see discussion at #1982

@nhooyr nhooyr removed their assignment Aug 30, 2020
@nhooyr nhooyr mentioned this issue Aug 30, 2020
@SPGoding
Copy link
Contributor

SPGoding commented Dec 5, 2020

I just experimented a bit and it seems pretty simple to migrate to git subtree 👀

Commit history to the patch file will sadly disappear though.

  1. Remove the Submodule: delete .gitmodules and lib/vscode and commit.
  2. Add Subtree: git subtree add -P lib/vscode https://github.com/microsoft/vscode.git release/1.51 --squash
    • This added all the content of Vanilla VS Code's release/1.51 branch to code-server/lib/vscode in a single commit.
  3. Bye Bye Patch:
    1. git apply --directory=lib/vscode ci/dev/vscode.patch
      • All the meaty changes are now applied to the local lib/vscode directory.
      • Note: yarn vscode:patch won't work here unless you add --directory=lib/vscode to the script, which isn't worth it as we will delete the script really soon.
    2. Commit something like Apply patch.
    3. Delete ci/dev/vscode.patch.
    4. Delete ci/dev/patch-vscode.sh and npm vscode:patch script.
    5. Delete ci/dev/diff-vscode.sh and npm vscode:diff script.
      • It's actually still possible to diff between the local VS Code and the Vanilla VS Code.
      • First set up remotes: git remote add vscode https://github.com/microsoft/vscode.git && git fetch vscode
      • Then git diff vscode/release/1.51 HEAD:lib/vscode
    6. Commit. Perhaps I missed a lot of scripts and workflows that should be updated though.

Now every change made to lib/vscode can be reviewed like how it should be. It just works™.

If you want to update the local lib/vscode with Vanilla VS Code, run git subtree pull -P lib/vscode <VS Code remote name> <VS Code remote branch name> --squash.

@nhooyr
Copy link
Contributor Author

nhooyr commented Dec 9, 2020

Thank you for writing down the process @SPGoding! Going to make closing this issue much easier.

@jsjoeio
Copy link
Contributor

jsjoeio commented Dec 17, 2020

Closed via #2476

@jsjoeio jsjoeio closed this as completed Dec 17, 2020
@nhooyr nhooyr added this to the v3.8.0 milestone Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

3 participants