Permalink
Browse files

Use shorter hash in "BUG closed" commit messages.

  • Loading branch information...
1 parent e62d1dc commit bfe59739f38f0e71935da0be66a692ecd2118a9e @mfp mfp committed Feb 8, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/gitbug.ml
View
8 src/gitbug.ml
@@ -262,6 +262,10 @@ let git_bug_add = git_do (fun name ->
open_bug bug;
git_commit (sprintf "BUG added: [%s] %s" id name))
+let digest_of_id s =
+ let s = first (split "_" s) in
+ String.sub s 0 (min 7 (String.length s))
+
let git_bug_autoclose = git_do (fun bugs ->
bugs |> iter begin fun id ->
try
@@ -274,7 +278,7 @@ let git_bug_autoclose = git_do (fun bugs ->
close_bug bug;
git "commit" [
"--quiet";
- "-m"; (sprintf "BUG closed: [%s] %s" id name);
+ "-m"; (sprintf "BUG closed: [%s] %s" (digest_of_id id) name);
bug;
all_bugs_dir () ^/ base;
dir_of_status `Close ^/ base;
@@ -283,8 +287,6 @@ let git_bug_autoclose = git_do (fun bugs ->
with _ -> ()
end)
-let digest_of_id = first @. split "_"
-
let git_bug_close = git_do (fun id ->
let bug, id = bug_file id in
let name = bug_name id in

0 comments on commit bfe5973

Please sign in to comment.