Ok, I have a bit of a convoluted setup, where I use git version 1.7.9.5, and have a git repository, which on the git side is a clone of a bare repo; and on the svn side, should be a clone of a remote SVN repository. On the other hand, there are no branches, and everything is done in master.
The remote repository was offline for a while; it just came back, and I seemingly managed to upload all outstanding commits via git svn dcommit
.
The problem is now, I tried making a new change/commit after this; and seemingly dcommit
wants to upload the wrong file - and fails with 'Transaction out of date'; I saw How to recover from an unwanted rename using git-svn: "Transaction is out of date", but that doesn't seem to answer this.
The setup is somewhat like this:
$ git config -l
svn-remote.svn.url=svn+ssh://user@myserver/remotepath/to/repo_svn
svn-remote.svn.fetch=:refs/remotes/git-svn
..
remote.origingit.url=file:///local/path/to/repo_bare.git
remote.origingit.fetch=+refs/heads/*:refs/remotes/origingit/*
Then I pull from the local bare repo git:
$ git svn fetch
user@myserver's password:
$ git pull --rebase origingit master
From file:///local/path/to/repo_bare
* branch master -> FETCH_HEAD
Current branch master is up to date.
$ git status -uno
# On branch master
nothing to commit (use -u to show untracked files)
I check to see if there is a difference from the SVN version:
# https://stackoverflow.com/questions/2426654/git-svn-status-showing-changes-that-are-not-committed-to-svn
$ git diff git-svn HEAD
diff --git a/folder/file.tex b/folder/file.tex
index 7201cc7..3df14bc 100644
--- a/folder/file.tex
+++ b/folder/file.tex
@@ -299,7 +299,7 @@ Test
-% test
+% test
% still testing
$ git diff --name-status remotes/git-svn
M folder/file.tex
... and there is - and it is the right change, in the file folder/file.tex
; so I'm trying to push/upload that to svn using dcommit
:
$ git svn dcommit --verbose
Committing to svn+ssh://user@myserver/remotepath/to/repo_svn ...
user@myserver's password:
M notes.txt
Transaction is out of date: File '/notes.txt' is out of date at /usr/lib/git-core/git-svn line 922
Now, the file I expected to be uploaded is ./folder/file.tex
; yet git svn dcommit tries to upload ./notes.txt
- which indeed, does exist, but there haven't been changes to it in this commit?!
Interestingly, if I do here:
$ git svn rebase
user@myserver's password:
First, rewinding head to replay your work on top of it...
$ git diff --name-status remotes/git-svn
$ git svn dcommit
Committing to svn+ssh://user@myserver/remotepath/to/repo_svn ...
$
... that is if I do git svn rebase
instead of git svn fetch
first, then there are no differences recognized between the git side and the svn side, and thus I can get nothing dcommit
ed (and so I don't even get a password prompt). EDIT: note that if I do git pull --rebase origingit master
after the git svn rebase
, the same as before happens (i.e. git diff --name-status
sees the right change, but git svn dcommit
fails with "Transaction is out of date:")
So my question is - why does git svn dcommit
insist on uploading this wrong file (in case git svn fetch
is ran first) - instead of the right file, which is otherwise correctly reported by git diff --name-status
?? How can I inspect that?
And how can I force git svn
to correctly synchronize the local git changes to the remote SVN?