4 ms·
Personally, I’d be very cautious about assuming that commit time has anything to do with work time. For at least 15 years I’ve had a policy - and so have the p
by dahart 7y ago
Personally, I’d be very cautious about assuming that commit time has anything to do with work time.
For at least 15 years I’ve had a policy - and so have the people on my teams - to avoid merging or committing to public branches at night or just before & during weekends so that you don’t accidentally hose other people on the team, who rely on automated builds & testing. We write code at all hours, but wait to commit/push/merge to master until the morning when everyone’s there.
I realize that not everyone has policies like that, but these are high profile programmers who are likely to have their own complicating factors. Linus, for example, commits a lot of merges that other people depend on; his code reviews and code writing might be on separate schedules.
- kawsper 7y agoIsn't that what feature or topic branches are for? Commit in your own little world, merge when you are ready to share.
- dahart 7y agoYes, that is what feature branches are for. The policy I’m talking about is referring to when people share, not when they commit to a feature branch. Sorry, I did initially described it only as “commit”, so that was my fault, not yours.
- breck 7y agoBut a lot of teams prefer that you do rebases and have a flat commit history, rather than have merge commits (so your commits would reflect the time of rebase onto master, not the time you first committed to your topic branch). I still think this a very cool back-of-the-envelope estimate though.
- srfilipek 7y ago> (so your commits would reflect the time of rebase onto master, not the time you first committed to your topic branch) That's not the case with git. By default it preserves the original commit time.
- yesbabyyes 7y agoI think they may be talking about squashing several commits before rebasing, creating new commit(s).
- breck 7y agoYes, this is what I meant. It wasn't clear, thanks. Generally squashing all the feature commits in a branch into 1 atomic commit in master.
- kzrdude 7y agoIt just calls it author date (it records one commit date and one author date), and one of those is preserved by rebasing. :)
- dchest 7y agoStrange policy about commits — why just not push at night or during weekends? Why's everyone not working on branches?
- dahart 7y ago> Strange policy about commits — why just not push at night or during weekends? Why's everyone not working on branches That is what I’m saying. The policy is avoid pushes to master. My policy does apply to branches too once there are more than a few people in the branch. Lots of people do work in branches, but everywhere I’ve worked, plenty of people skip branching when they’re making what they think are “small” changes. And some places I’ve been, the team has decided on a policy to skip branches & merges for single commit changes due to the history noise it causes. The policy is to avoid breaking changes being committed to master when people aren’t around to notice & fix it.
- stinkbug9o 7y agoYou’re describing merges, not commits, or pushes to remotes. One can commit and push to branches all day. Merging them to master without a heads up is a bad idea, except where teams have implemented a process that can handle it
- inlined 7y agoMany of us do a “squash merge” (use git rebase to compress to meaningful points in a CR and again before merging to master or feature branches). This creates a clean history at the expense of not being able to stalk others work at high granularity or get as large a score on github’s tracker.
- testvox 7y agoGit rebase interactive with fixup or squash will combine the commits into the first one. So the timestamp will still be somewhat reflective of when work is done (on average).
- strunz 7y agoThese are commit times, not merge times.
- deleted 7y ago[deleted]
- khalilravanna 7y agoLooks like you already addressed that merge time != commit time. That being said, while it's hard to make a blanket statement about what part of the working process a commit falls, I'd venture a guess that it's usually at the end of a period of work. Given that, the commit time covers an indeterminate period of time before the commit's time. So having no commits at 6 AM doesn't mean the person isn't working at 6 AM, but it probably means they aren't working at 5 AM or 4 AM. But that all being said, we only have a handful of people worth of data points and who's to say that Linus isn't someone who writes his code the previous day and commits it the next. Or that Guido isn't someone who makes lots of small commits as he's working. Hell, maybe they all squash multiple days worth of commits leaving it with a timestamp for a totally different time. tl;dr: Yeah, I don't know that we can glean that much super reliably from this data set.
- samstave 7y agoYEP. We instituted a policy of NO CHANGE FRIDAYS! To avoid fucking up peoples weekends.
- novok 7y agoI would avoid deploys before weekends, holidays, and vacations but you have problems with your pre-merge/pre-commit testing setup if it possibly screws people up when you land something.
- spullara 7y agoCommit time and push time are not the same time.
- killjoywashere 7y agoInterestingly, many pathologists have a policy of not signing out cases (do I commit this patient to a cancer-not-cancer diagnosis?) in the evenings. The move is generally more self-protective (tired minds make bad decisions), but certainly the 24-hour folks like hospitalists aren't looking for me to add more work to their nights and weekends either.