Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is git svn dcommit atomic?

Tags:

git-svn

In my company we have a subversion server and everyone is using subversion on their machines. However I'd like to use git, committing changes locally and then "push" them when I'm ready.

However, I can't understand what happens in the following situation. Let's say that I made 3 git commits locally and now I'm ready to "push" everything on the subversion server. If I understand correctly, git svn dcommit should basically make 3 commits sequentially on the server, right? But what happens if in the meantime (let's say between the second and the third commit) another colleague of mine issues a commit? The scenarios I can think of are:

1) git kind of "locks" (is that even possible?) the subversion server during commits so that my commits are doing atomically and my colleague's one is done after mine

2) The commit history on the server becomes mine1-mine2-other-mine3 (even if 'other' should fail since my colleague doesn't have an updated working copy at that point).

I think it's #2, but perhaps the committing speed is so high that this seldom becomes an issue. So which one is, #1 or #2?

like image 259
Emiliano Avatar asked Jul 03 '12 16:07

Emiliano


1 Answers

No locks are not supported in Git, it's not a Git way (Git way is branching and merginig). With git-svn you'll get mine1-mine2-other-mine3 history. If you need atomicity, have a look at SubGit project (it is installed into the SVN server and creates a pure Git interface for the SVN repository).

There was a similar question recently that might be interesting for you.

like image 149
Dmitry Pavlenko Avatar answered Sep 22 '22 20:09

Dmitry Pavlenko