[go: up one dir, main page]

Skip to content

create snippet from git patch and apply patch stored in a snippet

Problem to solve

When I review MR, sometimes I want to suggest changes that span multiple lines in multiple files and the "suggestions" GitLab feature is not powerful enough for that.

Then I result in creating the changes locally, running git diff > suggestions.patch and including this patch to one of my MR comments.

Proposal

Introduce two new commands: Create patch snippet and Apply patch snippet.

poc video

Create patch snippet

  1. run the command
  2. VS Code asks for the patch name and visibility
  3. VS Code runs git diff to get the patch
  4. project snippet with name patch: <name submitted by the user> is created

Apply patch snippet

  1. run the command
  2. VS Code shows a list of all snippets with patch: name prefix
  3. select one patch
  4. VS Code runs git apply to apply the patch

Further details

Links / references

/cc @phikai

Edited by Tomas Vik