Chris's Wiki :: blog/programming/ChangesHaveContext Commentshttps://utcc.utoronto.ca/~cks/space/blog/programming/ChangesHaveContext?atomcommentsDWiki2023-03-06T20:16:21ZRecent comments in Chris's Wiki :: blog/programming/ChangesHaveContext.By Peter Donis on /blog/programming/ChangesHaveContexttag:CSpace:blog/programming/ChangesHaveContext:41bd510bcf2094029a1f849dc84e33c3d8d46bf9Peter Donishttp://blog.peterdonis.com<div class="wikitext"><blockquote><p>When we move one more level up, branches are one expression of the context of changes (commits) themselves.</p>
</blockquote>
<p>While I agree that this is what many (if not most) Git users think branches mean, under the hood a branch has nothing whatever to do with an individual commit. There is no information in the commit that says what branch it is on. (This is in contrast to, say, Mercurial, where commits <em>do</em> include what branch they are on.) To assign a branch to a commit, unless it's the tip of a branch, you have to work backwards from the tip of <em>every</em> branch and see which ones end up on that commit--and there might be more than one.</p>
</div>2023-03-06T20:16:21Z