Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Truncate long branch names. Add to tested version list. Version bump.

  • Loading branch information...
commit b05ec1d2fba3e922e702d51570122eafe893a328 1 parent 21fd104
Pistos authored

Showing 2 changed files with 11 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 0 git-branch.rb
  2. +4 2 info.yaml
7 git-branch.rb
@@ -7,6 +7,13 @@
7 7
8 8 if File.exist? dir
9 9 branch = Dir.chdir( dir ){ `git symbolic-ref HEAD 2>/dev/null`[ /[^\/\n]+$/ ] }
  10 + if branch
  11 + width_max = $diakonos.main_window_width / 4
  12 + branch_truncated = branch[0..width_max]
  13 + if branch_truncated != branch
  14 + branch = branch_truncated[0...-2] << '..'
  15 + end
  16 + end
10 17 $diakonos.set_status_variable(
11 18 '@git_branch',
12 19 branch ? " git:#{branch} " : nil
6 info.yaml
@@ -2,8 +2,8 @@ name: git
2 2 description: A git extension for Diakonos
3 3 author:
4 4 name: Pistos
5   - uri: http://blog.purepistos.net
6   -version: 1.0.1
  5 + uri: http://github.com/Pistos
  6 +version: 1.0.2
7 7 uris:
8 8 homepage: http://github.com/Pistos/dk-git
9 9 repository: git://github.com/Pistos/dk-git.git
@@ -15,6 +15,8 @@ requirements:
15 15 - 0.8.11
16 16 - 0.8.12
17 17 - 0.8.13
  18 + - 0.8.14
  19 + - 0.8.15
18 20 notes: >
19 21 This extension provides several git-related features for Diakonos.
20 22

0 comments on commit b05ec1d

Please sign in to comment.
Something went wrong with that request. Please try again.