开发者

Git-Svn: Retain commit timestamp after dcommit

开发者 https://www.devze.com 2022-12-17 23:30 出处:网络
I\'ve been 开发者_JAVA百科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

I've been 开发者_JAVA百科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.


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.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号