Index: git_merge_base_tag.py |
diff --git a/git_merge_base_tag.py b/git_merge_base_tag.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..b2ecbfda29c69368941fc0a935e466301e74fa30 |
--- /dev/null |
+++ b/git_merge_base_tag.py |
@@ -0,0 +1,28 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+import sys |
+ |
+from subprocess2 import CalledProcessError |
+ |
+from git_common import nuke_merge_base_tag, manual_merge_base_tag |
+ |
+ |
+def main(argv): |
+ # TODO(iannucci): Use argparse |
+ assert len(argv) <= 2, "Must supply merge base or no arg." |
+ if len(argv) == 2: |
+ manual_merge_base_tag('HEAD', argv[1]) |
+ else: |
agable
2014/02/28 20:14:16
"git merge-base-tag other-branch" creates a tag.
"
|
+ try: |
+ nuke_merge_base_tag('HEAD') |
+ except CalledProcessError: |
+ print "No merge base tag currently exists for this branch." |
+ return 0 |
+ |
+ |
+if __name__ == '__main__': |
+ sys.exit(main(sys.argv)) |
+ |
+ |