Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git-Svn: Retain commit timestamp after dcommit

Tags:

git

git-svn

I've been using Git & Git-Svn for a year or so now and somehow just noticed that, after a dcommit, my commit history is preserved, but the timestamps aren't. In other words, each git commit entry is retained, but in Svn each commit has the same timestamp (more or less).

It's not unusual for me to work remotely for a day or so at a time, making any number of commits throughout that time. Ideally, I'd like for my svn log to reflect the times I made those commits to git rather than the time that the commit (along with any other commits) was dcommitted to svn. Is that possible?

Thanks.

like image 781
Rob Wilkerson Avatar asked Jan 19 '10 18:01

Rob Wilkerson


3 Answers

When git-svn creates a Subversion commit, it does roughly the same thing that you would normally do with Subversion to create a commit. This means that the Subversion timestamp will be the time that the git svn dcommit operation is run.

Even if you could change the commit timestamp, this may not be what you want to do. Normally people will expect that commit timestamps in Subversion follow a chronologically increasing sequence, and it might be confusing to see "backdated" timestamps in the repository.

like image 137
Greg Hewgill Avatar answered Nov 01 '22 16:11

Greg Hewgill


It is possible if you use SubGit at the server. It tries to preserve Git commit dates as it is possible (unfortunately, SVN repository has an internal restriction that dates should go chronologically, otherwise some binary search algorithms won't work correctly). I know no other solution that would modify svn:date within the same commit transaction. Git-svn uses libsvn SVN engine which, as I know, doesn't allow such svn:date modification (only after transaction when revision is created and you know its number).

like image 27
Dmitry Pavlenko Avatar answered Nov 01 '22 18:11

Dmitry Pavlenko


It should be definitely possible by changing the svn:date property but I don't think git-svn implements this.

git-svn-replay does implement this though, but it has a very different purpose than git-svn.

like image 1
Mauricio Scheffer Avatar answered Nov 01 '22 17:11

Mauricio Scheffer