MCPcopy
hub / github.com/timbrel/GitSavvy / run

Method run

core/commands/commit_compare.py:23–40  ·  view source on GitHub ↗
(self, base_commit, target_commit=None, file_path=None, title=None)

Source from the content-addressed store, hash-verified

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
43class gs_compare_against_reference(WindowCommand, GitCommand):

Callers 1

runMethod · 0.45

Calls 1

gitMethod · 0.80

Tested by

no test coverage detected