2 ms·
> You’re describing merges, not commits, or pushes to remotes. Both merges and commits can be pushed. I’m not exactly sure what distinction you’re trying to ma
by dahart 7y ago
> You’re describing merges, not commits, or pushes to remotes.
Both merges and commits can be pushed. I’m not exactly sure what distinction you’re trying to make.
Also, btw, I’m using git terminology, but not everyone uses git. I’m including my experience on teams that use Perforce, for example.
> One can commit and push to branches all day. Merging them to master without a heads up is a bad idea.
Yeah, right, exactly. You agree with me. My policy is about putting anything new in the master branch during off hours, because breaking changes that evade the tests may not get fixed until work hours, and prevent other people from working at night or over the weekend.
- kragen 7y agoThe article is about the times of day Git commits were made, not the times of day they were pushed, nor the times of day people used other source-control systems like Perforce. You said, "I’d be very cautious about assuming that commit time has anything to do with work time," citing your own policy of not pushing at night as an example of how "commit time" may not have anything to do with work time. Now you're saying, "My policy is about putting anything new in the master branch during off hours," which is to say, it's about pushes, not commits. This means that your original top-level comment is completely irrelevant to the article you are commenting on, which is unfortunate, since it's the top-voted comment on the article. You should edit the top-level comment to reflect that fact, or, if that's not possible, add a second-level comment retracting it.
- dahart 7y agoI stand by my top comment, avoiding pushes Friday and waiting until Monday often leads to both code commit times on Monday and merge commit times on Monday. (Edit: and BTW I know this for a fact, because we monitored average commit times to make sure the policy was being adhered to.) If you look at the code from the article, you’ll see that the author did not filter out merge commits. The word merge doesn’t even appear in the article. The OPs data includes merge commits. You’re trying to draw a hard and idealized line that doesn’t exist in real companies. Squashes often happen right before push. Stashing for the weekend rather than committing is common. People unsafely leaving uncommitted changes in their workspace over the weekend is common. Most devs in my experience are not git experts, and they don’t always use git in best practices kinds of ways. That is made evident every time there’s a git thread on HN. I am talking about commit time, my push policy affects my commit times. You can’t count on commit times to demonstrate anything.
- erikpukinskis 7y ago> You can’t count on commit times to demonstrate anything. Very extreme stance! Especially for so deep in thread. Sometimes it’s nice to make your ideas more specific as you go deeper in conversation, not just radicalize and double down.
- dahart 7y agoInteresting; I don’t consider what I said extreme or radical at all. I’ll rephrase it into a question: what do you claim that commit time demonstrates, considering that commit times can and do in practice very often change immediately prior to push?
- irishcoffee 7y agoHow can a commit time change?
- dahart 7y agoIt's a different commit. I was talking about introducing and then pushing new commits with different timestamps than the original, not somehow modifying timestamps on a specific commit. The commit that gets pushed can, and often does, have a different timestamp than the timestamp on the commit when the code was written.
- gitrebase 7y agogit commit --amend changes author time. git commit --amend --reset-author changes both author time and commit time. git rebase changes commit time. All three commands can be used just before a merge and push to clean things up. So there is no guarantee that the author time or commit time we see in the final commit history accurately represents the actual time at which the work was done.
- erikpukinskis 7y agoCommit time has some correlation with when code is written. It’s not perfect, but for me personally it’s usually close. Whether that correlation models reality closely enough to be useful depends. My understanding of your “commit time demonstrates nothing” assertion is that you are saying there is no useful information there, which seemed like a radical position for so deep in the thread.
- vlovich123 7y agoThat to me seems more like a sign that you should be enforcing a policy that pushing the merge button is gated by tests passing (& in successful application pushing the "merge button" should be nothing but a request to automation to apply the merge & do the tests before actually pushing it as a new master). If you're saying that there are breaking changes that are possible that test coverage is insufficient for, I would propose that the test coverage needs to be addressed. Is this advice for small 1 person repos? It can be if you want to develop good habits or be more diligent at preventing defects. It becomes more applicable as more people start contributing.
- dahart 7y agoTeams I’ve worked on do gate the merges by passing tests. You’re right; test coverage is insufficient. I’ve never worked anywhere with sufficient test coverage, I truly hope to some day, but new features in my experience have always come with new breakage and new tests. > Is this advice for small 1 person repos? I’ve never used a wait to push policy on my own repos, I’d say my policy doesn’t make any sense in that scenario. The goal of the policy is to prevent breaking other people, not to prevent breaking myself.
- stinkbug9o 7y agoYour original comment reads like pushes only goes to master, so you wait to push to a non master branch until working hours. I found the phrasing abstruse relative to my daily way of thinking of these things