From 4fd0cc46dcca81f7fb503cb9e5be340f9366b7c5 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 12 Sep 2011 16:02:49 -0400 Subject: Catch trying to refile an already filed bug If 'git bz file' is used with a commit message that contains a bug reference, prompt before filing again. https://bugzilla.gnome.org/show_bug.cgi?id=624461 --- git-bz | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/git-bz b/git-bz index 0c5a3e4..d5248e4 100755 --- a/git-bz +++ b/git-bz @@ -1965,6 +1965,17 @@ def do_file(*args): commits = get_commits(commit_or_revision_range) + bug_references = [c for c in extract_and_collate_bugs(commits)] + if len(bug_references) > 0: + print ("Found existing bug reference%s in commit message%s:" % + ("" if len(bug_references) == 1 else "s", + "" if len(commits) == 1 else "s")) + for reference, _ in bug_references: + print " ", reference.get_url() + if not prompt("File anyway?"): + print "Aborting" + sys.exit(0) + if global_options.add_url: check_add_url(commits, is_add_url=False) -- cgit v1.2.3