Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: git_squash_branch.py

Issue 184253003: Add git-reup and friends (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@freeze_thaw
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« git_reparent_branch.py ('K') | « git_reparent_branch.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« git_reparent_branch.py ('K') | « git_reparent_branch.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698