• 
      

    Adding in a smarter parent-base finding algorithm

    Review Request #6797 — Created Jan. 17, 2015 and discarded — Latest diff uploaded

    Information

    RBTools
    master

    Reviewers

    Main idea

    Given a tree like this one:

    A - * - * - * - * origin/master
      \ * - B - * - * origin/feature
             \- C - D topic
    

    when 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_base has to be in the remote repository, in other words, a ancestor of a commit of any branch origin/*. We would also like parent_base to be as young an ancestor of tip as possible, given the first constraint.

    I've worked out a git-rev-list query to find this.

    git rev-list $TIP --not --remotes=origin | tail -1
    

    should 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_parent is a new test, and I had to modify test_parse_revision_spec_no_args_parent to pass, since the parent base is no longer the same after my modifications.