简体   繁体   中英

Git-Svn: Retain commit timestamp after dcommit

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM