From 677da3c8694c8b33d443e4e33f565d65529fbf35 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Mon, 10 Apr 2023 19:44:07 +0000 Subject: [PATCH] Revert "Add --no-squash argument to git rebase-update" This reverts commit 80cc67cc006902c2d2ab52f9d80e0a384698ece6. Reason for revert: Not +1'd by anyone from owning team. Original change's description: > Add --no-squash argument to git rebase-update > > --no-squash makes it faster to run rebase-update when there are merge > conflicts and you know that squashing will not help. For example, I > store all of my branches in one commit each, so I know that squashing > isn't even possible because they are already squashed. > > Change-Id: I2679a855ad79d602a6d1ee09c140f2fd27ae20c5 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904096 > Reviewed-by: Dirk Pranke > Reviewed-by: Robbie Iannucci > Commit-Queue: Joey Arhar Change-Id: I0b577b053a3e6c7514e28cde4cb7849f50ecd64f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4411905 Bot-Commit: Rubber Stamper Auto-Submit: Joanna Wang Commit-Queue: Rubber Stamper --- git_rebase_update.py | 19 +++---------------- man/html/git-rebase-update.html | 10 +--------- man/src/git-rebase-update.txt | 5 +---- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/git_rebase_update.py b/git_rebase_update.py index 89eef3980..e557ab12a 100755 --- a/git_rebase_update.py +++ b/git_rebase_update.py @@ -141,7 +141,7 @@ def remove_empty_branches(branch_tree): print(git.run('branch', '-d', branch)) -def rebase_branch(branch, parent, start_hash, no_squash): +def rebase_branch(branch, parent, start_hash): logging.debug('considering %s(%s) -> %s(%s) : %s', branch, git.hash_one(branch), parent, git.hash_one(parent), start_hash) @@ -162,18 +162,8 @@ def rebase_branch(branch, parent, start_hash, no_squash): if git.hash_one(parent) != start_hash: # Try a plain rebase first print('Rebasing:', branch) - rebase_ret = git.rebase(parent, start_hash, branch, abort = not no_squash) + rebase_ret = git.rebase(parent, start_hash, branch, abort=True) if not rebase_ret.success: - if no_squash: - print(textwrap.dedent("""\ - Your working copy is in mid-rebase. Either: - * completely resolve like a normal git-rebase; OR - * abort the rebase and mark this branch as dormant: - git config branch.%s.dormant true - - And then run `git rebase-update` again to resume. - """ % branch)) - return False # TODO(iannucci): Find collapsible branches in a smarter way? print("Failed! Attempting to squash", branch, "...", end=' ') sys.stdout.flush() @@ -245,9 +235,6 @@ def main(args=None): 'if none specified.') parser.add_argument('--keep-empty', '-e', action='store_true', help='Do not automatically delete empty branches.') - parser.add_argument( - '--no-squash', action='store_true', - help='Will not try to squash branches when rebasing fails.') opts = parser.parse_args(args) if opts.verbose: # pragma: no cover @@ -308,7 +295,7 @@ def main(args=None): if git.is_dormant(branch): print('Skipping dormant branch', branch) else: - ret = rebase_branch(branch, parent, merge_base[branch], opts.no_squash) + ret = rebase_branch(branch, parent, merge_base[branch]) if not ret: retcode = 1 diff --git a/man/html/git-rebase-update.html b/man/html/git-rebase-update.html index 29a27a252..5e01291e0 100644 --- a/man/html/git-rebase-update.html +++ b/man/html/git-rebase-update.html @@ -756,7 +756,7 @@ git-rebase-update(1) Manual Page

SYNOPSIS

-
git rebase-update [-v | --verbose] [-n | --no-fetch] [-k | --keep-going] [--no-squash]
+
git rebase-update [-v | --verbose] [-n | --no-fetch] [-k | --keep-going]
@@ -869,14 +869,6 @@ Restoration

---no-squash -
-
-

- Skip the squash phase of rebase-update when there are merge conflicts. -

-
-
-v
diff --git a/man/src/git-rebase-update.txt b/man/src/git-rebase-update.txt index 07f0b908f..e7c0c2d2f 100644 --- a/man/src/git-rebase-update.txt +++ b/man/src/git-rebase-update.txt @@ -9,7 +9,7 @@ include::_git-rebase-update_desc.helper.txt[] SYNOPSIS -------- [verse] -'git rebase-update' [-v | --verbose] [-n | --no-fetch] [-k | --keep-going] [--no-squash] +'git rebase-update' [-v | --verbose] [-n | --no-fetch] [-k | --keep-going] DESCRIPTION ----------- @@ -78,9 +78,6 @@ OPTIONS --no-fetch:: Skip the `git fetch` phase of rebase-update. ---no-squash:: - Skip the squash phase of rebase-update when there are merge conflicts. - -v:: --verbose:: More text than your terminal can handle.