My problem:
I'm working on a project where upstream doesn't use source control of any sort. Yes, that's exactly the same reaction I had as well.
I keep track of their releases on a branch named upstream
. When new releases are made, I add them to this branch as a single commit, so at least I know what changed (in bulk) from the last release.
My changes (usually!) end up in the official releases, but because they don't use source control, my commits never do. Hence I want to find all the commits I've made since the last merge, as an "approximation" of what's changed between my release and theirs. Simple git log A..B
isn't what I want here.
So, here's the network graph. I want to find the last point on master where upstream was merged in. In this case, that's 9039b22b .
To make matters more fun, sometimes there's a few fix-ups done (on a side-branch of upstream) after upstream is imported, but before the merge into master. They're great for keeping the master branch clean and tidy, but make this particular problem harder. However we can rely upon 'upstream' to always point to the commit we want to search from.
Also, we can't rely upon finding just the last merge in general, because all sorts of things get merged into master (ie: contributions from every other developer who does use source control). I could try to do some sort of magic looking at text messages, but humans edit those. Likewise I don't want to use a tag which keeps moving, because moving public tags in git is evil, and having code which relies upon private tags is misguided.
Yes, this is all horribly painful. It's inspired posts on how wonderful FOSS is when done properly, and it's not been contributing to my happiness. Yes, I'm trying very hard to change processes. You can shed tears for me if you like.
@ilmari: Wait, did you mean
tail -n1
, because that certainly gives the commit that I'm after! :)