3 ms·
Really? Where? To my understanding, in a scenario like A--B--C--D <-master \ E--F--G <- branch1 \ H--I <-- branch2
by OkayPhysicist 4y ago
Really? Where?
To my understanding, in a scenario like
A--B--C--D <-master
\
E--F--G <- branch1
\
H--I <-- branch2
You can't identify the set of commits I and H (specifically, commits made under a given branch) without knowing (external to the information stored in commits normally) that branch2 branched off of branch1.
- comfypotato 4y agoIn short: I don’t know where, but I do know that it’s in there. My logic is that I’ve used tools that viz what you’re talking about. They actually have much prettier versions of the (admittedly very nice, thank you) drawing you made. Bitbucket has one. These viz would be impossible to make without the info. I read the git manual a couple of years ago. (All except the plumbing chapters.) There are commands that unveil deeper and deeper into whatever you’re querying, and it was in there somewhere. Give it a look. It’s a very nice manual. I read the whole thing (minus the plumbing) in less than 4 hours. If I had to guess, I would say git reflog is involved.
- OkayPhysicist 4y agoMy example was actually flawed. You can generate that information by iterating through all the heads, and then working backwards to the first commit that is reachable by another head. The better question, that Git actually can't answer, is whether E, F, and G were made under branch1 or branch2. Reflog could answer the question, but reflog is local only, and at least in theory temporary.