Skip to content

Commit

Permalink
Use shorter hash in "BUG closed" commit messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfp committed Feb 8, 2010
1 parent e62d1dc commit bfe5973
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gitbug.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit bfe5973

Please sign in to comment.