Skip to content

Commit

Permalink
Enhancement: Show commit hash in blame annotations
Browse files Browse the repository at this point in the history
The default templates for line annotations and the status bar text are
modified to include the commit hash of the selected line.
  • Loading branch information
DeathAxe committed Nov 9, 2019
1 parent 599d422 commit e9de039
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions GitGutter.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
// {{line_committer_tz} -- the timezone string of commit
// {{line_summary}} -- the first line of the commit message
// {{line_previous}} -- the hash of the previous commit
"line_annotation_text": "{{line_author}} ({{line_author_age}}) · {{line_summary}}",
"line_annotation_text": "{% if line_commit[:7] != '0000000' %} {{line_commit[:7]}} | {% endif %}{{line_author}} ({{line_author_age}}) · {{line_summary}}",

//
// Status Bar
Expand Down Expand Up @@ -234,7 +234,7 @@
"{% if deleted > 0 %}, {{deleted}}-{% endif %}",
"{% if inserted > 0 %}, {{inserted}}+{% endif %}",
"{% if modified > 0 %}, {{modified}}≠{% endif %}",
"{% if line_author and line_author_age %}, ⟢ {{line_author}} ({{line_author_age}}){% endif %}",
"{% if line_commit[:7] != '0000000' %}, ⟢ {{line_commit[:7]}} | {{line_author}} ({{line_author_age}}){% endif %}",
"{% endif %}"
]
}
4 changes: 2 additions & 2 deletions Preferences.sublime-settings-hints
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
// {{line_committer_tz} -- the timezone string of commit
// {{line_summary}} -- the first line of the commit message
// {{line_previous}} -- the hash of the previous commit
"git_gutter_line_annotation_text": "{{line_author}} ({{line_author_age}}) · {{line_summary}}",
"git_gutter_line_annotation_text": "{% if line_commit[:7] != '0000000' %} {{line_commit[:7]}} | {% endif %}{{line_author}} ({{line_author_age}}) · {{line_summary}}",

//
// Status Bar
Expand Down Expand Up @@ -241,7 +241,7 @@
"{% if deleted > 0 %}, {{deleted}}-{% endif %}",
"{% if inserted > 0 %}, {{inserted}}+{% endif %}",
"{% if modified > 0 %}, {{modified}}≠{% endif %}",
"{% if line_author and line_author_age %}, ⟢ {{line_author}} ({{line_author_age}}){% endif %}",
"{% if line_commit[:7] != '0000000' %}, ⟢ {{line_commit[:7]}} | {{line_author}} ({{line_author_age}}){% endif %}",
"{% endif %}"
]
}

0 comments on commit e9de039

Please sign in to comment.