pleroma.debian.social

@dos
It does not make sense from a git technology point of view, but it makes perfect sense from a code history point of view, and that really is the only view that matters when talking about branches IMO.

I mean, git is just the implementation.
@b0rk

@dos
Of course, that does mean you need to remember that the implementation does not necessarily always link up with the concepts, and that thus the set of commits that are part of your branch can change based on actions outside your branch, but that's fine.
@b0rk

@dos
Respectfully disagree.

The question was, how do you think about git branches.

I know that the technical implementation of a git branch is just a pointer to a single commit which can move around to other commits, with some overridable safeguards so you don't get too surprised when things are done. However, that's not a very useful way to think about it, IMO.
@b0rk

@dos
So instead, I think of git branches as a set of commits that have a common ancestor with the parent branch, and which can at some point be merged back into the parent branch. That's a much more useful way to think about it, which is supported in all but unusual situations.

When I encounter an edge case in real life, I know about it enough to deal with it. That just doesn't often happen though.
@b0rk

@dos
Sigh.

The question is not 'how does git implement branches', it's 'how do you think of branches in git'

My answer is closest to option 1.

I know that's not how git works! But that's fine.

What you don't seem to understand is that it's perfectly possible to have a simplified mental model of how software works, which lets you get on with actual work, without getting confused when the model doesn't match reality, because you're aware that your mental model is @b0rk

incomplete and there are edge cases where it will fall on its face.

When that happens, I'll remember how things work technically and resolve the situation.

But for everyday work? Nope, not happening.

And yes, I *also* have git repositories with multiple root commits. Doesn't change about how I think about branches.
@b0rk @dos
replies
1
announces
0
likes
0

@dos
I'm very much aware, thanks for git 101 (which I'm not needing, thanks)

I think that how you think about your daily work is sometimes more important than how the software itself works. For git branches, this very much applies.

You seem to disagree, which is fine. But just because the way I usually think about things is different from how things really are, doesn't mean I don't know how things really work.
@b0rk

@dos
And that's fine.

What I'm saying is that I find it much easier to just Get Stuff Done if I use a mental model that is closer to how I work than it is to the actual implementation of things.

You seem to prefer the opposite.

None of this makes either you or me wrong, it just means we're different 🤷
@b0rk

@dos
Obviously there's a limit to how far you can go with this, but then I'm not advocating a model that does not even partially map onto the way things really are.

Git's data model is awesome and great and can let you do massively impressive things, but I just want to write code, you know? And I'll fall back on it when my simple model doesn't work, but for day to day things? Nah, thanks.
@b0rk

@dos
Me, angry? Not even close 😉
@b0rk