Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for 'Git open...'. #200

Merged
merged 1 commit into from Sep 27, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions history.py
@@ -1,4 +1,5 @@
import functools
import re

import sublime
from git import GitTextCommand, GitWindowCommand, plugin_file
Expand Down Expand Up @@ -38,17 +39,18 @@ def blame_done(self, result, position=None):

class GitLog(object):
def run(self, edit=None):
return self.run_log('--', self.get_file_name())
fn = self.get_file_name()
return self.run_log(fn != '', '--', fn)

def run_log(self, *args):
def run_log(self, follow, *args):
# the ASCII bell (\a) is just a convenient character I'm pretty sure
# won't ever come up in the subject of the commit (and if it does then
# you positively deserve broken output...)
# 9000 is a pretty arbitrarily chosen limit; picked entirely because
# it's about the size of the largest repo I've tested this on... and
# there's a definite hiccup when it's loading that
command = ['git', 'log', '--pretty=%s\a%h %an <%aE>\a%ad (%ar)',
'--date=local', '--max-count=9000', '--follow' if args[1] else None]
'--date=local', '--max-count=9000', '--follow' if follow else None]
command.extend(args)
self.run_command(
command,
Expand Down Expand Up @@ -155,7 +157,7 @@ def branch_panel_done(self, picked):
if 0 > picked < len(self.results):
return
self.branch = self.results[picked].split(' ')[-1]
self.run_log(self.branch)
self.run_log(False, self.branch)

def log_result(self, result_hash):
# the commit hash is the first thing on the second line
Expand Down