gitsvndcommit

commit to svn unstages last commit?


Today i have encountered a weird problem when "dcommitting" my master HEAD to google code svn repository. Below an extract of what I did. I'd almost say that I do have uuid clash but i consider that to be unlikely. I'm getting more and more experienced with git but sometimes i'm still puzzled...

Some changes in my presentation branch...

jerry [~/dev/myproject]$git checkout master
Switched to branch 'master'
jerry [~/dev/myproject]$git merge presentation
Updating c5e5816..f5a376c
Fast-forward
 js/iPath.js        |    5 +----
 presentation/paper.html |    6 ++++--
 2 files changed, 5 insertions(+), 6 deletions(-)

Changes are now in master

jerry [~/dev/myproject]$git status
# On branch master
# Untracked files:
#   presentation/.#paper.html
nothing added to commit but untracked files present (use "git add" to track)

Now I'm dcommitting to svn.

jerry [~/dev/myproject]$git svn fetch
jerry [~/dev/myproject]$git svn dcommit
Committing to https://myproject.googlecode.com/svn/trunk ...
No changes
8e67cdc7e8bad816e402c1b9c72b5e84c492e907~1 == 8e67cdc7e8bad816e402c1b9c72b5e84c492e907
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
Unstaged changes after reset:
M   js/iPath.js
M   presentation/paper.html
Unable to extract revision information  from commit f5a376ca4a10a4807abbbea131b94b828ee88269~1

svn trunk is unmodified and my latest checkin (merge from presentation) is unstaged:

jerry [~/dev/project]$git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   js/iPath.js
#   modified:   presentation/paper.html
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   presentation/.#paper.html

Last commit is also removed from git log. What is going on?


Solution

  • you cannot dcommit "git-merges", because subversion does not have the same concept of merges as git (and any other dvcs: parent tracking) has. recent versions try to emulate it with svn:merge-info property, but it's not the same.

    if you want to dcommit your dev branch changes to subversion, you have to rebase them first on master:

    git rebase master dev
    

    then you should be able to dcommit.