Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the git commit date to be the same as the git author date #93

Open
jphx opened this issue Feb 17, 2016 · 5 comments
Open

Set the git commit date to be the same as the git author date #93

jphx opened this issue Feb 17, 2016 · 5 comments
Milestone

Comments

@jphx
Copy link

jphx commented Feb 17, 2016

I've converted an RTC stream using this utility and I notice that the git commit date in each commit is the date/time when it was committed during the conversion rather than the same time as the author commit date. Would be be possible to enhance the utility to at least optionally set that too?

The "git commit" and "git commit-tree" man pages say you can set the GIT_COMMITTER_DATE environment variable on the commit command to override that, so it ought to be possible.

I can write a post-processing utility to set the commit date to the author date on all the commits in my git repository, but it would be more convenient if the utility did it that way already.

@WtfJoke
Copy link
Member

WtfJoke commented Feb 18, 2016

Hi again jphx :)

Yeah, thats a good idea. Actually it was once the plan to do that, but I forgot about it.
Are you interested in implementing it? Else I would implement it, but probably takes some time until I find some spare time.

@WtfJoke WtfJoke added this to the 1.2 milestone Feb 18, 2016
@jphx
Copy link
Author

jphx commented Feb 19, 2016

I will see if I can find the time to make the change. I looked at the rtc2git code and copying the author date to the committer date seems straightforward. Is that the right approach, though? On your wiki page Getting your History Files, you mention that "The result of the compare command in terms of timeline is not correct. The result is ordered by creation date and not by date delivered.". Perhaps that creation date ought to be used as the git author commit date, and the date from the history should be used as the committer date. If that's the best approach, it's probably best that you tackle the change when you have a chance, since you're more familiar with the RTC data.

Fyi, I copied the author date to the committer date in my repository after the conversion with this command:

git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' -- --all

@WtfJoke
Copy link
Member

WtfJoke commented Feb 19, 2016

I will see if I can find the time to make the change.

Allright, sounds promising. If you find the time just write it here. In case I would find the time earlier than you, I would assign the bug to myself and will write a comment. Is that a deal? 😉

I looked at the rtc2git code and copying the author date to the committer date seems straightforward. Is that the right approach, though?
Yeah, thats the right approach. 👍

I think its not necessary to make our lifes harder by tangling out the delivery date from rtc for each item. I guess it would be only possible (if it really is) by executing another command for each changeset and this would slow down the process a lot, which wouldnt be good thing. Also these dates usually only differ on some corner cases, so its not really a big deal in my opinion if we use the same date for author date and commiter date. 😃

@jphx
Copy link
Author

jphx commented Feb 19, 2016

It's a deal. If I have time, I'll work on the change.

@WtfJoke
Copy link
Member

WtfJoke commented Feb 20, 2016

Sounds great. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants