| 21 | """ |
| 22 | |
| 23 | def run(self, base_commit, target_commit=None, file_path=None, title=None): |
| 24 | base_commit = base_commit or "HEAD" |
| 25 | target_commit = target_commit or "HEAD" |
| 26 | merge_bases = self.git('merge-base', base_commit, target_commit, '-a').strip().splitlines() |
| 27 | if not merge_bases: |
| 28 | self.window.status_message("No common base for {} and {}".format(base_commit, target_commit)) |
| 29 | return |
| 30 | |
| 31 | branches = ( |
| 32 | [base_commit, target_commit] |
| 33 | + ['{}^!'.format(base) for base in map(self.get_short_hash, merge_bases)] |
| 34 | ) |
| 35 | self.window.run_command("gs_graph", { |
| 36 | 'all': False, |
| 37 | 'file_path': file_path, |
| 38 | 'branches': branches, |
| 39 | 'follow': base_commit |
| 40 | }) |
| 41 | |
| 42 | |
| 43 | class gs_compare_against_reference(WindowCommand, GitCommand): |