{"thread":{"id":"33788","subject":"git log --cherry with disjoint roots","startedAt":"2013-05-11T10:53:21Z","lastAt":"2013-05-11T10:53:21Z","messageCount":1,"participants":["John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"216988","messageId":"20130511105321.GC2299@serenity.lan","threadId":"33788","inReplyTo":null,"subject":"git log --cherry with disjoint roots","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-11T10:53:21Z","receivedAt":"2013-05-11T10:53:21Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"I use my own integration branch manager[1] to manage my WIP changes to\nvarious projects, including git.git and one of the features of this is a\n--status option that shows whether anything that I'm tracking has been\nmerged to the base branch I'm building on top of.  Since the commit IDs\nwill be different after being sent to the list, this uses the --cherry\noption to git-log.\n\nToday I realised that I wasn't tracking a git-gui change I sent to the\nlist a couple of weeks ago [2] and so I pulled that in and added it.\nGetting the status for this is significantly slower than anything else\nbecause it does this:\n\n    git log --cherry --oneline origin/master...git-gui-fix-subdir\n\nand although there are only 5 commits in git-gui-fix-subdir not in\nmaster there are 31964 commits in master not in git-gui-fix-subdir and\n--cherry seems to inspect all of those.  So I get:\n\n    $ time git log --oneline --cherry master...git-gui-fix-subdir \\\n        >/dev/null\n    real    0m41.378s\n    user    0m40.248s\n    sys     0m0.986s\n\nNow I know that I don't need to check anything older than commit 8ead1bf\n(Merge tag 'gitgui-0.17.0' of git://repo.or.cz/git-gui, 2012-10-17) and\nif I tell Git that it gets significantly better:\n\n    $ time git log --oneline --cherry master...git-gui-fix-subdir \\\n        --not 8ead1bfe111085ef1ad7759e67340f074996b244 >/dev/null\n    real    0m2.163s\n    user    0m2.070s\n    sys     0m0.084s\n\nI'd like a way to automatically find the last merge that pulled in a\nsubtree so that my script can construct the above command line without\nme needing to tell it the correct SHA-1 every time I have a branch that\nis affected by this.\n\nI guess this boils down to having a way to ask Git to list merges that\nhave a parent in a specified range, but perhaps I'm missing an easier\nsolution to this.\n\nI also wonder if it would be interesting to cache patch IDs rather than\ngenerating them every time...\n\n[1] http://johnkeeping.github.io/git-integration/\n[2] http://article.gmane.org/gmane.comp.version-control.git/222646\n"}]}