4 ms·
Read the git diff docs, it can span multiple commits. Builds are tied to pushes, not commits. You will see the changes for both A and B. When you create a new b
by verdverm 7y ago
Read the git diff docs, it can span multiple commits. Builds are tied to pushes, not commits. You will see the changes for both A and B. When you create a new branch, you add the latest hash in git history to a file. When you build, you compare the latest commit against X from the file.
Note, this is around branches, not commits. Generally people tie features to branches and build branches. You want to build all changes from the new work that is off of the main branch. Don't think about it at the commit level, that's just how the bookkeeping is done.
The hard / manual part is maintaining commit X. You end up with merge conflicts when two branches are in PR and one gets merged. Order doesn't matter.
I'll try to post something this weekend, I'll link it here and probably create a small repo
- taleodor 7y agoThanks, looking forward. Yeah, totally get about git diff - I'm talking exactly about how you know that it is commit X that you need to compare with and not commit A. Also my preferred workflow is different from yours. I try to use trunk based development with commits to master directly, branches generally allowed either on dev machines only or long-term release branches which are never merged back to master (on some high-compliance projects). I try to reduce the number of branches as much as I can - there is some pain there in committing to master and ensuring green build, but then you don't have that pain when merging (following advice of Continuous Delivery book by David Farley, Jez Humble).
- verdverm 7y agoTrunk doesn't really work for teams because you need multiple features to be worked in parallel Commit X is stored in a well known file and committed to git
- taleodor 7y agoGoogle does trunk-based development for thousands of people - https://trunkbaseddevelopment.com/ https://trunkbaseddevelopment.com/ (Although if you mean short-lived 1-day feature branches always merged back to trunk - we're on the same page here). Worked fine for my teams as well, although I usually use multi-repo - part of what Reliza Hub does is it gives holistic view of multi-repo structure.
- verdverm 7y agoJust because Google does something a particular does not mean it's right for everyone else. Most of us will never experience the problems of their scale. Do you check out subtrees from the monorepo like Google does?