Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

54%
+4 −3
Q&A How can I make --reset-author the default?

I do a lot of rebasing and amending of my topic branches. I don't think it's especially useful for me or my colleagues to see in the logs what date it was when I first started working on the partic...

3 answers  ·  posted 4y ago by Hyperlynx‭  ·  last activity 4y ago by Charlie Brumbaugh‭

Question git
#6: Post edited by user avatar Hyperlynx‭ · 2020-11-16T03:27:01Z (about 4 years ago)
Tried to clarify the scenario
  • I do a lot of rebasing and amending of my topic branches. I don't think it's especially useful for me or my colleagues to see in the logs what date it was when I first started working on the particular topic - only when I actually submitted it.
  • I know I can explicitly reset the date of my commit to the current time using `git commit --amend --reset-author`. But is there any way I can change that behaviour to be the default when I rebase or amend, so I don't have to type it every time?
  • (Alternatively: am I missing something here? Is it actually useful for people to know when I started a piece of work rather than when I finished it?)
  • I do a lot of rebasing and amending of my topic branches. I don't think it's especially useful for me or my colleagues to see in the logs what date it was when I first started working on the particular topic - only when I actually submitted it.
  • I know I can explicitly reset the date of my commit to the current time using `git commit --amend --reset-author`. But is there any way I can change that behaviour to be the default when I rebase or amend, so I don't have to type it every time?
  • For example: on Monday I put in a new feature and submit the patch for peer review. On Tuesday, my team lead wants me to make some changes to my patch and resubmit. On Wednesday I make the changes, `git commit --amend` them, and submit the new patch for review. On Thursday the new changes are approved. I pull the master branch and rebase my changes on it.
  • Right now, that commit entry in my log will still be timestamped Monday, even though I amended on Wednesday and rebased on Thursday. In the future, when we look through the logs, the useful date is when I've finished and push the change (Thursday), not the date of the first commit that no longer exists (Monday). To update the date, now on Thursday, I need to go a `git commit --amend --reset-author --no-edit`. If I don't do that, it will still say that my change was on a Monday, when it was not.
  • (Alternatively: am I missing something here? Is it actually useful for people to know that I started work on the topic on Monday, rather than that the change was actually put in on Thursday? Is there a way to see both the datestamp of a commit and the date the commit was actually added to the tree?)
#5: Post edited by user avatar Hyperlynx‭ · 2020-11-13T00:04:29Z (about 4 years ago)
#4: Post edited by user avatar Hyperlynx‭ · 2020-11-13T00:03:17Z (about 4 years ago)
#3: Post edited by user avatar Hyperlynx‭ · 2020-11-13T00:03:00Z (about 4 years ago)
Clarified a bit. Also `git commit --amend --date=` doesn't actually work.
#2: Post edited by user avatar Hyperlynx‭ · 2020-11-12T03:09:19Z (about 4 years ago)
#1: Initial revision by user avatar Hyperlynx‭ · 2020-11-12T03:07:04Z (about 4 years ago)
How can I make --date the default?
I do a lot of rebasing and amending of my topic branches. I don't think it's especially useful for me or my colleagues to see in the logs what date it was when I first started working on the particular topic - only when I actually submitted it.

I know I can explicitly reset the date of my commits using `git commit --amend --reset-author`, or `git commit --amend --date=`. But is there any way I can change that behaviour to be the default, so I don't have to type it every time?

(Alternatively: am I missing something here? Is it actually useful for people to know when I started a piece of work rather than when I actually pushed it?)
git