Live data from Hacker News

Software is made between commits

zed.dev

221–230 of 230 posts

Re: Software is made between commits

#221

Earlier quoted context omitted.

Github default squash commit template & merge strategy makes it easy to go from the squash commit to the feature branch. So you get best of both worlds -- clean master and granular history on the branch. Bisect on master tells you which branch broke it, and then bisect on the branch if you want to find the original commit. Same with blame. IMO squash 4 the win. Github squash defaults work well. Gitlab squash defaults…

That's interesting, so you keep the branches from before the squash -- but do you also rename them somehow, to show that they're now "frozen historic versions"?

Actually, what I usually do in Github is set the PR branches to delete when you squash-merge the PR, but then the PR always has an "undelete branch" button you can use forver in case you want to look at the details of the branch and don't have a local copy of the branch.

Re: Software is made between commits

#222
I think this makes a lot of sense in the context of Zed’s multiplayer editing. Maybe that works well for a small team working on a single product, but that doesn’t seem like it’d scale super well. I loved tight collaboration long ago on online notepads despite constantly breaking stuff for each person…

Re: Software is made between commits

#223
post #215

This just sounds to me like "frequent auto-commits" with less trust in git. git can handle frequent auto-commits just fine . If you want to "rollup" frequent auto-commits into "cleaner" top-level commits but also keep all the point-in-time "conversation" of your auto-commits, then `git merge --no-ff` from time to time and use tools like `--first-parent` to focus in on "top-level" commits over "conversation" commits.…

This is what what I do. I never see the commits from branches but they are there if I need them. Even git blame can be setup to use --first-parent

git bisect also works great with --first-parent. It will never stop surprising me how many people see the two-dimensional DAG of git as a bug to be avoided rather than a very useful feature (and then spend time reinventing things that git could do natively if they just used the second dimension of the git graph a bit more intentionally).

Re: Software is made between commits

#224

Just a stream of thoughts: if git commits were a list of sequential primitive changes instead of diff snapshots, conflict resolution would be trivial in most cases. Not without cons of course: commit byte size, public WIP work and leaked secrets/unwanted edits.

[flagged]

Re: Software is made between commits

#225
post #82

All the things in between my commits is a messy soup. Looking there is not useful to anyone. I rewrite my history with git rebase so each commit is small and atomic. The story I create with my commits is what explains why things are as they are, it doesn't matter if it's the true chronological story on how it actually happened. I agree with the author that reviewing pull requests is too late. The problem with pull re…

This is the response I expected to see here. Reading through the article, I'm reminded of my dismay reading this exact sentiment every time version control is discussed. So many people are so quick to throw away their history so that things look "tidy". It makes no sense, but somehow it fits a certain programmer-brain logic that is surprisingly common. My style is to commit often. Like dozens of times per day. Commit…

> So many of these things would have been really painful to find if I'd had to sift through every line of a big commit.

> So to watch people intentionally balling up an entire PR's worth of commits and squashing them together to throw away the only (in my mind) thing that version control is good for, is truly baffling.

> But yeah, there are plenty of people like the parent in that camp

I'm confused. The parent doesn't want big commits but rather, as they wrote twice, commits that are small, atomic and without noise. So presumably "fix typo" would be removed during rebase but "rename function" would stay and be separate from "implement logic".

Re: Software is made between commits

#226

Earlier quoted context omitted.

This is the response I expected to see here. Reading through the article, I'm reminded of my dismay reading this exact sentiment every time version control is discussed. So many people are so quick to throw away their history so that things look "tidy". It makes no sense, but somehow it fits a certain programmer-brain logic that is surprisingly common. My style is to commit often. Like dozens of times per day. Commit…

> So many of these things would have been really painful to find if I'd had to sift through every line of a big commit. > So to watch people intentionally balling up an entire PR's worth of commits and squashing them together to throw away the only (in my mind) thing that version control is good for, is truly baffling. > But yeah, there are plenty of people like the parent in that camp I'm confused. The parent doesn'…

I guess the difference between the parent and me is that I’ve been around long enough to see my share of “fix typo “ and “remove logging “ commits that accidentally removed the line above or below.

That’s the commit I want to find six months later when the SVG text is blurry because we’re no longer forcing opacity to 1.0 at the end of a transition.

Re: Software is made between commits

#227

Earlier quoted context omitted.

This is the response I expected to see here. Reading through the article, I'm reminded of my dismay reading this exact sentiment every time version control is discussed. So many people are so quick to throw away their history so that things look "tidy". It makes no sense, but somehow it fits a certain programmer-brain logic that is surprisingly common. My style is to commit often. Like dozens of times per day. Commit…

Github default squash commit template & merge strategy makes it easy to go from the squash commit to the feature branch. So you get best of both worlds -- clean master and granular history on the branch. Bisect on master tells you which branch broke it, and then bisect on the branch if you want to find the original commit. Same with blame. IMO squash 4 the win. Github squash defaults work well. Gitlab squash defaults…

Imagine a feature in git, where when you merge, you get a single new commit on the main branch like you want, where the message could describe the changes in summary, like you want. But also: the commit contains a reference to the source branch so you can easily find it back, break it down, bisect into it, all without having to leave git or rely on data stored at 3d parties. That would be pretty neat! It's like, the best of both worlds, but all inside git!

Well. That's what a merge commit is.

Your approach is nearly identical to creating a merge commit, except the pointer to the second parent (the "original branch") is indirectly recorded via the PR link, instead of directly inside git.

If you create merge commits, then you have your "clean main branch" (via git log --first-parent), as well as the extended history with all the source commits (via git log). And as a bonus, merge commits are supported by every git host, and they work the same in all of them.

I think the whole "squash merge vs merge commit" discussions would be a lot less prevalent if --first-parent would be how git and git hosts displayed commit histories by default. :(

Re: Software is made between commits

#228

Earlier quoted context omitted.

I don't want the private API key I temporarily hardcoded in my public history. Nor do I want the drag of worrying about so much as sneezing in the general vicinity of a secret in my editor window, when I already self review before commit. I don't want the unkind rant about a coworker's design as I attempt to figure out what they were smoking when they made the thing I'm trying to use, needlessly offending them. For s…

I'm not advocating committing secrets to version control. But you can learn to phrase your WTFs about your colleague's code politely and constructively. I would even argue that this an absolutely basic skill for professionals. It typically leads to faster and better answers whenever a discussion arises. Even if confusion seems to spread in a discussion, I would expect the person who realizes this first to call that o…

> But you can learn to phrase your WTFs about your colleague's code politely and constructively. I would even argue that this an absolutely basic skill for professionals. It typically leads to faster and better answers whenever a discussion arises.

Phrasing things politely and constructively is what I'm explicitly advocating for when I'm calling for "tact", yes. But said phrasing is not necessairly the very first thoughts out of my mind. When we push back on sharing our raw thoughts, it's precisely because we want a moment to be able to translate from passionate, driven, and perhaps rude thoughts - to polite, if perhaps a bit professionally dispassionate words. From unconvincing incendiary moral judgements against the cult of the singleton, to concrete examples of maintainence concerns and tradeoffs that can be discussed by everyone. From things that barely make sense in the context of our own minds, to things communicated clearly within the context and bounds of our shared understanding.

> Even if confusion seems to spread in a discussion, I would expect the person who realizes this first to call that out and and to reset the conversation.

Simply calling out confusion is insufficient to resolve confusion. Being able to narrow down what I'm confused about is an important skill and first step towards either unconfusing myself, or seeking help from others, allowing them to aid me in solving said confusion.

Unconfusing others is a step more difficult. Unlike with my own confusion, I find it necessary to build an accurate mental model of their thought process through my own indirect observation and questions, to understand where they've misunderstood, the correct understanding, and then a means of explaining and contrasting those two states through nothing more than clear communication to bring them out of said confusion. I may have to construct full blown examples, showing a concrete way their own initial biases fail them.

These are important skills and steps to take, of course, and you're right that there's nothing magic about it, but this is something I've expended a lot of time on over the decades I've been puttering around in development circles. It's time intensive, requiring one or more people focusing on a single individual's issues, just to reset things to a baseline of being unconfused enough to do good work.

And, of course, it will always be necessary, and I'm glad to help. It's a skill I believe I'm good at, and by unblocking coworkers and friends, I can potentially spend minutes of my time to save hours or even days of theirs, which is well worth it. But it's also worth taking the time to avoid such scenarios coming up again. It saves me time, and it saves them time.

Sometimes that means clearing up ambiguous or confusing documentation.

Sometimes that means keeping others at arm's length - at least until I'm at least no longer confused about what exactly I'm confused about.

Re: Software is made between commits

#229

Many years ago I helped a friend with some draft that had to do with him finishing his doctorate. It ended up being maybe 50-60 between three of us and as fine grained as possible. That agents need something "beyond git" is lost on me but it keeps coming up. For one subject the tool doesn't matter -- in fact it can be obtuse like git or bash and it's fine because agents will handle it. Then for another thing the stor…

The interesting question is whether agents actually benefit from finer-grained history or whether they're better served by semantic checkpoints – "this works, this doesn't" rather than line-by-line diffs. Git wasn't designed for that, but neither is anything else yet.

If works/doesn't are semantic checkpoints, then I use that every day for myself with Git notes.

Re: Software is made between commits

#230

Earlier quoted context omitted.

That's interesting, so you keep the branches from before the squash -- but do you also rename them somehow, to show that they're now "frozen historic versions"?

Actually, what I usually do in Github is set the PR branches to delete when you squash-merge the PR, but then the PR always has an "undelete branch" button you can use forver in case you want to look at the details of the branch and don't have a local copy of the branch.

Interesting, didn't know about that Github functionality.

I'd like to not depend that much on Github, and instead I'm thinking about having some kind of archival repo where noisy boring historical stuff can be saved (but I'd delete the branches in the main repo). Or renaming historical branches, eg adding an "old/" prefix.

Post reply on HN