diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-19 12:30:25 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-19 12:36:01 +0200 |
commit | 7f5922f905831a85ffee4c9226b65715899ba758 (patch) | |
tree | d18a29a2ec13706efa7f5e9efc9515a92cf4513d /bug/bug.go | |
parent | 459bb8747d9e84493b8d04a3172e6758452a75b9 (diff) | |
download | git-bug-7f5922f905831a85ffee4c9226b65715899ba758.tar.gz |
rework all the commands to use cobra as a parser
Diffstat (limited to 'bug/bug.go')
-rw-r--r-- | bug/bug.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -14,6 +14,7 @@ const BugsRefPattern = "refs/bugs/" const BugsRemoteRefPattern = "refs/remote/%s/bugs/" const OpsEntryName = "ops" const RootEntryName = "root" +const HumanIdLength = 7 // Bug hold the data of a bug thread, organized in a way close to // how it will be persisted inside Git. This is the datastructure @@ -347,7 +348,8 @@ func (bug *Bug) Id() string { // Return the Bug identifier truncated for human consumption func (bug *Bug) HumanId() string { - return fmt.Sprintf("%.8s", bug.id) + format := fmt.Sprintf("%%.%ds", HumanIdLength) + return fmt.Sprintf(format, bug.id) } // Lookup for the very first operation of the bug. |