aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2020-01-13 08:35:32 +0100
committerThierry Reding <treding@nvidia.com>2020-01-13 08:35:32 +0100
commitdf7a56429f80819d84390eadccd053cbcc35f05c (patch)
tree446746e2cae49052be531ccdc054c201fba16265
parent199dfe4e6d96daf7203a5ae00f5764c9e60e684d (diff)
downloadmaint-scripts-df7a56429f80819d84390eadccd053cbcc35f05c.tar.gz
tms: Properly compute widths for [GIT PULL index/count] prefix
In order for the [GIT PULL index/count] subject prefix to look pretty, compute the width of the index and count fields based on the number of pull requests for the given target. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rwxr-xr-xtms4
1 files changed, 2 insertions, 2 deletions
diff --git a/tms b/tms
index c5d2b5b..f483617 100755
--- a/tms
+++ b/tms
@@ -219,8 +219,8 @@ class Branch:
to = ', '.join(target.to)
cc = ', '.join(target.cc)
- # XXX
- width = 1
+ # make [GIT PULL index/count] look pretty
+ width = math.ceil(math.log10(count + 1))
message = email.message.EmailMessage()
message['From'] = author