Skip to content

Commit 66f39d4

Browse files
authored
Merge pull request #1942 from timbrel/fix-1941
2 parents 0357ccc + b3389db commit 66f39d4

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

core/interfaces/branch.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ def _render_branch_list(self, remote_name, branches, descriptions, human_dates=T
247247

248248
def get_date(branch):
249249
if human_dates:
250-
return branch.human_committerdate
250+
# Remove possible timezone information, e.g. transform "Wed 14:28 -0700"
251+
# to just "Wed 14:28".
252+
return re.sub(r" [+-]\d{4}$", "", branch.human_committerdate)
251253

252254
d = branch.relative_committerdate
253255
if d == "12 months ago":

syntax/branch.sublime-syntax

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ contexts:
6868
4: meta.git-savvy.branches.branch.name gitsavvy.gotosymbol
6969
5: comment.git-savvy.branches.branch.extra-info
7070

71-
- match: '^ (▸)?\s+([0-9a-f]{7,40}) ([^\s]+)([^(-]+?)?(\(.+?(?:, (gone))?\))?( \- .+)?$'
71+
- match: '^ (▸)?\s+([0-9a-f]{7,40}) ([^\s]+)\s([^(-].+?)?((?:, )?\(.+?(?:, (gone))?\))?( ?\- .+)?$'
7272
captures:
7373
0: meta.git-savvy.branches.branch
7474
1: punctuation.symbol.active-branch.git-savvy

syntax/test/syntax_test_branch.txt

+30
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,34 @@
1414
f21e6a8 old (origin/develop, ahead 13, behind 40)
1515
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - meta.git-savvy.branches.branch.active-branch
1616
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
17+
b20264b iter-branches-dashboard-code 12 minutes ago
18+
# ^^^^^^^ constant.other.git-savvy.branches.branch.sha1
19+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.git-savvy.branches.branch.name gitsavvy.gotosymbol
20+
# ^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.date
21+
fb8240d status-bar-updater (fork/status-bar-updater, gone)
22+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
23+
# ^^^^ constant.git-savvy.upstream.gone
24+
fb8240d status-bar-updater (fork/status-bar-updater)
25+
# ^^^^^^^^^^^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
26+
369ff34 fix-environment 6 years ago, (origin/fix-environment)
27+
# ^^^^^^^^^^^ comment.git-savvy.branches.branch.date
28+
# ^^^^^^^^^^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
29+
▸ 7f561b6 master Wed 20:04 -0700, (origin/master) - desc
30+
# ^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.date
31+
# ^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
32+
# ^^^^^^ comment.git-savvy.branches.branch.description keyword
33+
▸ 7f561b6 master Wed 20:04 -0700 - desc
34+
# ^^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.date
35+
# ^^^^^^ comment.git-savvy.branches.branch.description keyword
36+
7f561b6 master (origin/master) - desc
37+
# ^^^^^^^^^^^^^^ comment.git-savvy.branches.branch.tracking-info
38+
# ^^^^^^^ comment.git-savvy.branches.branch.description keyword
39+
7f561b6 master - desc
40+
# ^^^^^^ comment.git-savvy.branches.branch.description keyword
41+
67df3f5 better-error-handling 12 months ago - desc
42+
# ^^^^^^^^^^^^^ comment.git-savvy.branches.branch.date
43+
# ^^^^^^ comment.git-savvy.branches.branch.description keyword
44+
45+
46+
1747

0 commit comments

Comments
 (0)