Sublime Forum

SublimeMerge with git-svn is amazing ! Need a bit more support

#1

I just discovered some days ago is that Git supports Subversion out of the box with git-svn and allows bidirectional operation between a Subversion repository and Git !

This is a great feature to me because now we can use the best git client outta there to handle things rather than dealing with old svn clients most of the time not anymore updated, just maintained, ie rabbitcvs that comes with a shit tons of python2 dependencies.

I do every of my svn operations now in Sublime Merge and I’m happy with it, Stashing, Commiting, Logs, everything works except you seem to not have implemented the command

git svn dcommit

I think is the equivalent to git push to send files on server, on git for subversion, the command git svn commit is used to commit stashes locally.

As shown on basic examples

Not a big problem since only that is missing I execute it on command line, but that would be excellent if you could support git-svn a bit more, it is installed by default with git and subversion present, that’s an excellent way to start experimenting git when you are forced to use a subversion with teams and I would definitely buy it as I bought Sublime Text

With a bit more work and not a shit tons imo, you can really sell Sublime-Merge as the best Git & Subversion client, really.

0 Likes

#2

You can add git svn dcommit to the command palette, a key binding or a menu. We don’t currently have plans of turning Sublime Merge into a svn client by using git-svn.

1 Like

#3

Ok, you are supporting it indirectly anyway since git svn is included in Git core and if I can add custom commands that’s even more helpful.

That’s a pity because you search for “subversion/svn client” on the web, nowhere Sublime-Merge is mentionned with git-svn, but it works wonderfully and is probably as it is, the best svn client outta there under linux

Will buy soon

Edit: That was not that hard ! :heart_eyes:
Main.sublime-menu

[
  {
    "id": "main",
    "caption": "Subversion",
    "mnemonic": "S",
    "children":
    [
      {
        "caption": "Fetch",
        "command": "git",
        "args": {"argv": ["svn", "fetch"]}
      },
      {
        "caption": "Rebase",
        "command": "git",
        "args": {"argv": ["svn", "rebase"]}
      },
      {
        "caption": "dCommit",
        "command": "git",
        "args": {"argv": ["svn", "dcommit"]}
      }
    ]
  }
]

Action.sublime-menu

[
  {
    "caption": "-"
  },
  {
    "caption": "Svn Fetch",
    "command": "git",
    "args": {"argv": ["svn", "fetch"]}
  },
  {
    "caption": "Svn Rebase",
    "command": "git",
    "args": {"argv": ["svn", "rebase"]}
  },
  {
    "caption": "Svn dCommit",
    "command": "git",
    "args": {"argv": ["svn", "dcommit"]}
  }
]

Default.sublime-commands

[
  {
    "caption": "Svn Fetch",
    "command": "git",
    "args": {"argv": ["svn", "fetch"]}
  },
  {
    "caption": "Svn Rebase",
    "command": "git",
    "args": {"argv": ["svn", "rebase"]}
  },
  {
    "caption": "Svn dCommit",
    "command": "git",
    "args": {"argv": ["svn", "dcommit"]}
  }
]
0 Likes

#4

Thanks for posting the custom commands. Unfortunately, i somehow can get them working. SublimeMerge complains that all “git svn <…>” commands are not git commands. Works on the commandline.

git: ‘svn’ is not a git command. Use ‘–help’ …

Any idea? Thanks alot!

0 Likes

#5

You might need to switch to a system installed git due to this reason: No Git documentation or add--interactive

2 Likes

#6

@youaresoomean

For the svn support inside git,

You need a git version > 2.4.4 + subversion

Since your git command returns a textual message that svn command is missing, I believe you are just missing the subversion package.

I like the custom commands options indeed, I use the svn one everyday. By far the best svn client option you will find outta there, conflict resolution is so simple, search filters inside sublimemerge are outstanding
:slight_smile:

1 Like

#7

I have a full git 2.26.x in the default installation directory. How do i tell sublimemerge to use this instead of the minimal one shipping with sublime merge itself? ‘git svn’ commands work fine on the command line with the system-installed version…

0 Likes

#8

Didn’t knew sublime ships with a git, on Arch I just installed git and subversion and it worked inside and outside sublime has I was expecting hmmm

I would try the interactive tip mentionned above , or symlink git sublime to git system or would read the installation procedure of git under Arch to check if I’m not missing any env variable. You can check this here

Hope you sort this out

Ps: btw remember not all the commands works inside sublime with git svn , for example git pull is equivalent to git svn fetch and git push is git svn commit, in case you wondering why you get errors with the default pull and push buttons, this is expected.

1 Like

#9

Settings/Preferences -> Advanced tab -> Git Binary

The ... button will show you the options: system, bundled, & Browse... to choose a custom installation.

1 Like

#10

Thanks alot guys! Works perfectly now!

0 Likes

#11

Hello, I have added the menu items but I cannot seem to open the SVN repository with Sublime Merge, it says " W:\SublimeSVNTest21 doesn’t look like a git repository". Anyone has any ideas on how to get it into Sublime Merge?

0 Likes

#12

How did you create the cloned svn repository? Note that bare repos (& similar) are not currently supported in Sublime Merge (#476, #853).

0 Likes

#13

I created a test repo using Turtoise SVN. I am not as familiar with SVN.

I used the “Create repository here” Windows File explorer context menu. It then created a bunch of directories and files. I didn’t know where to create my files so I checked out the repository I have just created, having the following url: “file:///W:/SublimeSVNTest/trunk”. It created a directory called “SunlimeSVNTest”, it doesn’t have those files and directories I mentioned earlier but it has a .svn directory inside.

I tried to open this checked out “SublimeSVNTest” directory in Sublime Merge. I am pretty sure I am doing something wrong here

0 Likes

#14

Sounds like you’re just trying to open a SVN repository in Sublime Merge. Sublime Merge can only open git repositories, and if you want to use git’s compatibility with svn you need to do so explicitly. See https://git-scm.com/docs/git-svn

0 Likes

#15

Ah yes that is exactly what I’m trying to do, I have added the commands to use git-svn in Sublime Merge, but I cannot get the repo in Sublime Merge to use those commands.

(Edit) Oh wait do I need to init it with git-svn ?

0 Likes

#16

Simplest approach is to run git svn clone which handles the initialization & downloading of the SVN repository: https://git-scm.com/docs/git-svn#Documentation/git-svn.txt-emcloneem

0 Likes

#17

Great thanks! This worked. I had a little trouble getting the URL right but it eventually worked:smiley:

2 Likes

#18

Ty for all the likes guys :slight_smile: Very appreciated, when I did this I did not expect the post to get that much attention.

Support of svn has been super useful here this is great to use the best Git client to handle Svn tasks.

Luckily todat Svn is old story and its full Git now, I hope you too, Git is fantastic ! :slight_smile:

0 Likes