Re:Why large companies and fast-moving startups are banning ...
by jmharvey on Friday December 29, 2023 @03:25PM
(#38809794)
I'm a fan of the workflow where the PR gets squashed in the upstream git repo, but the individual commits are preserved in the PR in the code review tool. I feel that Phabricator handles this well.
[ Parent
| on HN ]
Re:Why large companies and fast-moving startups are banning ...
by usrusr on Friday December 29, 2023 @03:41PM
(#38809963)
But does that still lose the source commit long term? What I'd love to have is a mechanism that keeps references to the pre-squash commits at blame granularity, allowing one to dig deeper into the commit messages associated with a given line. Kind of like a sourcemap, but for squash instead of transpile.
Re:Why large companies and fast-moving startups are banning ...
by 91edec on Friday December 29, 2023 @04:07PM
(#38810188)
When you squash merge on github the new commit references the old PR. If you don't delete branches on merge you would keep the commit history on that branch, but then you have to battle with branchs persisting forever.
Re:Why large companies and fast-moving startups are banning ...
by cplusplusfellow on Friday December 29, 2023 @04:13PM
(#38810258)
Branches are mostly free, so this isn’t a problem if they are properly named.
“try-again-something5” doesn’t cut it but “$ticket-at-least-five-words-here” does.
Re:Why large companies and fast-moving startups are banning ...
by TheCleric on Saturday December 30, 2023 @12:53PM
(#38817082)
Branches are not cognitively free. Searching through the haystack of hundreds of branches to find a particular needle is a pain.
Re:Why large companies and fast-moving startups are banning ...
by cplusplusfellow on Saturday December 30, 2023 @02:13PM
(#38818024)
You’re translating the problem from : searching through branches that are named according to their ticket and what they are meant to accomplish to: complex and not-context-free git bisect.
Re:Why large companies and fast-moving startups are banning ...
by jacobegold on Friday December 29, 2023 @04:51PM
(#38810651)
You don't lose it long term if you're using GitHub PRs — GitHub keeps the "reflog" (quoted because I imagine their implementation may not actually use reflog) of the branch indefinitely, even after force pushes. Graphite (built to replicate the Phabricator workflow) enables viewing and diffing these versions. (disclaimer, I helped build this)
Re:Why large companies and fast-moving startups are banning ...
by easton on Friday December 29, 2023 @03:31PM
(#38809849)
GitHub and Azure DevOps also do that, you just need to know where to look.
I don’t mind squashing either, unless I’m being really intentional or rewriting my history my intermediate commits couldn’t be reverted without leaving stuff broken (totally a me problem of course).
Re:Why large companies and fast-moving startups are banning ...
by hamburglar on Friday December 29, 2023 @04:00PM
(#38810125)
Intermediate commits being snapshots of “broken” state isn’t a problem at all. When I quit for the day, I commit, broken or not, and pick it up in the morning. I want to be able to drop my laptop in a puddle and still pick up where I left off when I get a new one.
Re:Why large companies and fast-moving startups are banning ...
by iimblack on Friday December 29, 2023 @10:28PM
(#38812603)
I think the problem is putting those broken commits into the trunk. Ideally you want to clean up your commits so if you need to revert you don’t accidentally break your build and so reading thru history isn’t awful.
Re:Why large companies and fast-moving startups are banning ...
by hamburglar on Thursday January 04, 2024 @09:32PM
(#38875027)
Nobody anywhere suggested putting broken commits in trunk. This is why branches exist.