0

When running git svn dcommit, git-svn will automatically do the equivalent of git svn rebase if not all commits present in the SVN repository have integrated into the branch being committed. Is it possible to disable this behavior? I would like git svn docmmit to fail instead, like git push by default fails in a non-fast-forward push.

I am talking about this behavior:

$ git svn dcommit
Committing to svn://[...]
    [lists committed files]
Committed r1857
    [lists changes in the repostiory since last rebase]
r1856 = 3062cfbe5c3ab56d5d6e16cadba55cfa73e35c6e (refs/remotes/svn/trunk)
    [lists differences between committed revision and latest repository revision]
r1857 = 3a57b29f6e5006925f0ab7ec931e9ecf3b64b11b (refs/remotes/svn/trunk)
W: d3fbaa461d5ef643e400be7f6727fe6ef89a9d26 and refs/remotes/svn/trunk differ, using rebase:
:040000 040000 16b8ed30058d274f5f57560e06f2e8598312e0b4 dbe9d86a21aee9f4832021436f489b8e3ed8ed6e M  [...]
First, rewinding head to replay your work on top of it...
Applying: [rebases commits that were not yet committed]

After that the rebased commits are automatically committed.

Feuermurmel
  • 9,490
  • 10
  • 60
  • 90

1 Answers1

1

You could probably try a combination of git svn fetch and git merge --ff-only <svn/branch>

Mykola Gurov
  • 8,517
  • 4
  • 29
  • 27
  • Hmmm … This _will_ prevent a commit if there are newer commit in the SVN repository than my branch is rebased on before I start the operation. But it will not prevent two people committing at the same time. Maybe this is the best we can get when committing to SVN. I'd accept an answer if it references a source claiming that SVN cannot prevent concurrent commits like Git does for push operations. – Feuermurmel Nov 20 '14 at 15:05
  • I am surprised to see after a quick test that SVN does allow committing changes when client has outdated revision, as long as the files sent hasn't been modified on the server. Otherwise it will stop, and git-svn would show message `ERROR from SVN: Transaction is out of date`. – Mykola Gurov Nov 20 '14 at 20:24
  • I'm getting the feeling that this is just how SVN works. I.e. SVN can only guarantee the integrity of a commit across the files changed in the commit and not more. – Feuermurmel Nov 27 '14 at 13:11