Adding in a smarter parent-base finding algorithm
Review Request #6797 — Created Jan. 17, 2015 and discarded — Latest diff uploaded
Main idea
Given a tree like this one:
A - * - * - * - * origin/master \ * - B - * - * origin/feature \- C - D topicwhen we
rbt post, it would like to have three things,
'base': A revision to use as the base of the resulting diff.
'tip': A revision to use as the tip of the resulting diff.
'parent_base': (optional) The revision to use as the base of a
parent diff.
Now,parent_basehas to be in the remote repository, in other words, a ancestor of a commit of any branchorigin/*. We would also likeparent_baseto be as young an ancestor oftipas possible, given the first constraint.I've worked out a
git-rev-listquery to find this.git rev-list $TIP --not --remotes=origin | tail -1should give the oldest ancestor that is not reachable from a public branch, so it's parent will be the best parent base.
Now with tests!
test_diff_finding_parentis a new test, and I had to modifytest_parse_revision_spec_no_args_parentto pass, since the parent base is no longer the same after my modifications.