Create patch and apply patch in SmartGit
Asked Answered
J

4

12

I have a online repository hosted at Bitbucket but one of the developers has Internet connection problems and most of the time can't connect to the repository. In order to mantain the same code at repository and shared between developers I think in create patch and send him trough email. Since him and I use SmartGit client it's possible to create and apply patch from SmartGit? I read the docs but didn't find any helpful, any advice on this? I don't know if Git Flow feature is the solution

Jingo answered 23/5, 2014 at 15:38 Comment(0)
F
21

This seems to be supported from version 6.5 of SmartGit. Here's the changelog: https://www.syntevo.com/smartgit/changelog-6.5.x.txt (under SmartGit 6.5 preview 1)

The following steps worked fine for me.

Creating a patch:

  1. Open the Log
  2. Pick a branch and right-click on a commit
  3. Select "Format patch..." and save the file

Applying a patch:

  1. Open the Log
  2. Go to "Tools" and then "Apply patch..."
  3. Select the patch

The patch will be applied on the branch that is currently checked out.

Frantic answered 10/6, 2015 at 14:26 Comment(2)
Some additional information: I have SmartGIT (v7.1.4) on Windows 10 (64 bits) and Xubuntu Linux 16.04 (64 bits), but unfortunately those features are available only on Windows version, although I can't understand why.Polyhydroxy
If these, or any, commands are missing, go to preferences, tools & click on "re-add Defaults" - mine were missing, presumably from updates over the years.Bousquet
T
8

Looks like as of SmartGit 22.1 the Format Patch feature is gone again. Thankfully they have it as an example tool on their website: https://docs.syntevo.com/SmartGit/22.1/Example-Tools.html#format-patch

Save this content to a file format-patch.yml and use the Import button on the Tools page of the preferences to restore the Format Patch feature from SmartGit versions < 22.1.

tools:
- name: Format Patch
  fileStarter: {command: '${git}', parameters: 'format-patch -o "${dirSelect}" -1 ${commit}'}
  useForOpen: false
  waitUntilFinished: true
  filePattern: '*'
- name: Format Patch
  fileStarter: {command: '${git}', parameters: 'format-patch -o "${dirSelect}" ${commit}..${commit2}'}
  useForOpen: false
  waitUntilFinished: true
  filePattern: '*'
Topographer answered 21/11, 2022 at 12:51 Comment(2)
It sais 404 not found. Where do I have to save format-patch.yml?Employ
Updated the link. But in the answer I’m already quoting: “Save this content to a file format-patch.yml and use the Import button on the Tools page of the preferences”. So file locations doesn’t matter, it’s just a means to import the command.Topographer
F
0

I asked the SmartGit support team whether they implemented git format-patch in the GUI or not. I got the following answer:

No. If it needs a selected commit, it also cannot be worked around using external tools.

Faze answered 16/7, 2014 at 7:12 Comment(0)
G
0

To add Apply patch feature, create a file apply-patch.yml with contents

tools:
- name: Apply Patch
  fileStarter: {command: '${git}', parameters: 'apply "${fileOpen}"'}
  useForOpen: false
  waitUntilFinished: true
  filePattern: '*'

.. and Import it to SmartGit in Edit > Preferences > Tools.

Grundy answered 11/8, 2024 at 12:1 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.