News for hackers. Stuff that matters.
Re:Things I wish everyone knew about Git (Part I) by mjd on Wednesday June 29, 2022 @06:07PM (#31926284)
I'm reading it and I think I got it right. The Git community, the Git documentation, and the Git tools all refer to "branches", and I think what they mean when they talk about "branches" is much closer to what I described than to what you did.

For example, consider this very ordinary-sounding phrase that I just picked out of the git-rebase man page:

> If the upstream branch already contains a change you have made …

I don't think your account can explain what is meant by this.

In any case, I didn't make the choice casually, thoughtlessly, or from ignorance.

Re:Things I wish everyone knew about Git (Part I) by skrebbel on Thursday June 30, 2022 @01:18AM (#31928930)
> In any case, I didn't make the choice casually, thoughtlessly, or from ignorance.

Obviously, and if you got the idea that I thought you did then I apologize for that.

Anyway, the git docs aren't exactly known for getting the nuances of its own concepts right, which adds to the general confusion.

That said, I think I see your point now: it's the same as how a reference to a linked list is actually just the head of the linked list, but you still call it a list and not a head.

I have to admit that maybe I didn't see the forest for the trees.

Re:Things I wish everyone knew about Git (Part I) by pierrebai on Wednesday June 29, 2022 @07:34PM (#31927067)
The problem is that your rebuttal isn't one: you are not addressing any of the points made. And those points are important precisely because branches are not a range of commits which is why they are cumbersome to work with.
Re:Things I wish everyone knew about Git (Part I) by layer8 on Wednesday June 29, 2022 @06:26PM (#31926446)
But what’s the precise rule defining what constitutes the commits of a branch, after you reach a merge point? Does the branch end there? If not, which parent of the merge does it go? It’s not clear a priori.
Re:Things I wish everyone knew about Git (Part I) by mjd on Wednesday June 29, 2022 @07:04PM (#31926817)
I don't think there is a precise rule. because the exact meaning depends on the context. In part 3 of the series, in the section about "branches are fictitious", that's what I will say.

The talk has an abbreviated version: https://perl.plover.com/classes/git-tips/samples/slide018.ht... It's an illustration of just one example of this: If we rebase "branch X" onto commit B, we rebase only the three green commits. But if we rebase it onto C, we consider X to contain the two dark blue commits also.

Are the dark blue commits part of branch X? It depends on what you're trying to communicate.

Re:Things I wish everyone knew about Git (Part I) by layer8 on Wednesday June 29, 2022 @09:54PM (#31927927)
Right, and that’s what makes “branch” a vague notion in git. It’s not clear what exactly is meant with “branch x” when it’s not just about the labeled tip, and often enough no further clarification is given.
Re:Things I wish everyone knew about Git (Part I) by shkkmo on Thursday June 30, 2022 @12:30PM (#31934931)
Every commit contains an ordered list of it's parent commits. You could think of the 'main' history as being the chain of commits that are always the first ancestor to each other and this can be a use thing to display when generating a commit history.

However, the history of a commit is always the entire tree of ancestors. This entire tree is the precise definition of what constitutes all the commits of a branch.

Thus while I agree that it is not wrong to view a branch as a bookmark, I also think that attempts to nitpick the man page's use of the term fall flat here. "Commit contained in a branch" just means: "commit contained in the history of the commit the branch currently points to." and isn't ambiguous.

Re:Things I wish everyone knew about Git (Part I) by edflsafoiewq on Wednesday June 29, 2022 @06:35PM (#31926536)
I think it goes to all the parents, ie. a branch denote not a linear sequence of commits, but an entire sub-DAG.