OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 import sys | |
6 | |
7 from git_common import current_branch, upstream, get_or_create_merge_base_tag | |
8 from git_common import run, clean_refs | |
9 | |
10 | |
11 def squash(): | |
12 branch = current_branch() | |
13 parent = upstream(branch) | |
14 merge_base = get_or_create_merge_base_tag(branch, parent) | |
15 run('reset', '--soft', merge_base) | |
16 run('commit', '-a', '-C', 'HEAD@{1}') | |
17 | |
18 | |
19 def main(): | |
Ryan Tseng
2014/02/28 21:22:05
Add usage and --help
| |
20 squash() | |
21 clean_refs() | |
22 return 0 | |
23 | |
24 if __name__ == '__main__': | |
25 sys.exit(squash()) | |
26 | |
OLD | NEW |