4 ms·
The data regarding what branch a commit was made is available. It’s all available if you dig deep enough. What you’re talking about sounds like the work of a g
by comfypotato 4y ago
The data regarding what branch a commit was made is available. It’s all available if you dig deep enough.
What you’re talking about sounds like the work of a git visualization tool made for fixing problems. I do love a repo viz where I can see the tree of branches for helping me understand where something went wrong. The surface level stuff people use day to day is as simple as it needs to be.
- OkayPhysicist 4y agoReally? 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.