git-plus icon indicating copy to clipboard operation
git-plus copied to clipboard

Feature request: support for git svn dcommit

Open soltysek opened this issue 9 years ago • 8 comments

I'm working with many git svn repos (as my company mostly uses svn..) and it would be nice to run dcommit.

Now I have to edit files, commit changes, etc. But when I want to 'push' changes to svn repository I have to open console and run git svn dcommit manually.

Is there any chance to add this feature?

soltysek avatar Mar 10 '16 15:03 soltysek

This is a good point. I've been thinking about this. I'd like to have the push command do dcommit if the repo is using the git-svn bridge. That's something to come hopefully.

For now, you can use the Run command and enter svn dcommit from within atom. It may save you a few keystrokes

akonwi avatar Mar 11 '16 02:03 akonwi

Also it would be good if pull will trigger svn rebase for git-svn repos.

soltysek avatar Mar 17 '16 13:03 soltysek

I've just published a new version with a feature that allows users to define their own commonly used commands locally. Since this is a unique feature that may not be common to a lot of the user base of the package, I think it is a good candidate to test out as a custom command. Currently, custom commands are an experimental feature and I would love if you gave it a try and provided feedback.

You can read about it here

akonwi avatar Dec 28 '16 18:12 akonwi

Could you provide some documentation/howto about defining this custom commands? For some reason:

atom.packages.onDidActivateInitialPackages (p) ->
if gitPlus = atom.packages.getActivePackage('git-plus')?.mainModule.provideService()
  gitPlus.registerCommand 'atom-text-editor', 'akonwi:rebase-from-svn', ->
    gitPlus.getRepo() # If there are multiple repos in the project, you will be prompted to select which to use
      .then (repo) -> gitPlus.run repo, 'svn rebase'

atom.packages.onDidActivateInitialPackages (p) ->
if gitPlus = atom.packages.getActivePackage('git-plus')?.mainModule.provideService()
  gitPlus.registerCommand 'atom-text-editor', 'akonwi:dcommit', ->
    gitPlus.getRepo() # If there are multiple repos in the project, you will be prompted to select which to use
      .then (repo) -> gitPlus.run repo, 'svn dcommit'

does not work for me - atom command palette (ctrl + p) doesn't show new commands.

soltysek avatar Jan 03 '17 12:01 soltysek

I'm sorry, I just realized I didn't paste the hyperlink to the README in that last comment but it seems like you found it (https://github.com/akonwi/git-plus#experimental-features).

What you have looks fine. Are you sure, you've enabled custom commands in the package settings?

akonwi avatar Jan 03 '17 16:01 akonwi

Yes, I have checkbox next to 'Custom Commands' in settings checked.

soltysek avatar Jan 04 '17 10:01 soltysek

That's really odd. Both those commands appear for me when I declare them in my init file.

For what it's worth, you can put both those declarations in one call to onDidActivateInitialPackages so it looks like this:

atom.packages.onDidActivateInitialPackages (p) ->
  if gitPlus = atom.packages.getActivePackage('git-plus')?.mainModule.provideService()
    gitPlus.registerCommand 'atom-text-editor', 'akonwi:dcommit', ->
      gitPlus.getRepo() 
      .then (repo) -> gitPlus.run repo, 'svn dcommit'

    gitPlus.registerCommand 'atom-text-editor', 'akonwi:rebase-from-svn', ->
      gitPlus.getRepo() 
      .then (repo) -> gitPlus.run repo, 'svn rebase'

Maybe it's something about the formatting of your file that might be causing an issue

akonwi avatar Jan 04 '17 17:01 akonwi

After upgrading to version 7.0.5 it started to work! thanks :)

soltysek avatar Jan 09 '17 13:01 soltysek