aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-19 12:30:25 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-19 12:36:01 +0200
commit7f5922f905831a85ffee4c9226b65715899ba758 (patch)
treed18a29a2ec13706efa7f5e9efc9515a92cf4513d /bug
parent459bb8747d9e84493b8d04a3172e6758452a75b9 (diff)
downloadgit-bug-7f5922f905831a85ffee4c9226b65715899ba758.tar.gz
rework all the commands to use cobra as a parser
Diffstat (limited to 'bug')
-rw-r--r--bug/bug.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 398bdb9f..88a0ff8b 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -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.