From 324b1e118a2a6fcde87f5aecec570f5c9bd87001 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 1 Mar 2015 18:17:12 -0800 Subject: [PATCH] rebase: teach `git cola rebase` about `--[no-]autosquash` Signed-off-by: David Aguilar --- bin/git-cola | 8 ++++++++ cola/cmds.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/git-cola b/bin/git-cola index c0809bd95..948b7b7e6 100755 --- a/bin/git-cola +++ b/bin/git-cola @@ -233,6 +233,13 @@ def add_rebase_command(subparser): 'resolved conflicts') parser.add_argument('--root', default=False, action='store_true', help='rebase all reachable commits up to the root(s)') + parser.add_argument('--autosquash', default=True, action='store_true', + help='move commits that begin with ' + 'squash!/fixup! under -i') + parser.add_argument('--no-autosquash', default=True, action='store_false', + dest='autosquash', + help='do not move commits that begin with ' + 'squash!/fixup! under -i') parser.add_argument('--committer-date-is-author-date', default=False, action='store_true', help="passed to 'git am' by 'git rebase'") @@ -440,6 +447,7 @@ def cmd_rebase(args): 'verify': args.verify, 'rerere_autoupdate': args.rerere_autoupdate, 'root': args.root, + 'autosquash': args.autosquash, 'committer_date_is_author_date': args.committer_date_is_author_date, 'ignore_date': args.ignore_date, 'whitespace': args.whitespace, diff --git a/cola/cmds.py b/cola/cmds.py index 89527039b..a4d0105df 100644 --- a/cola/cmds.py +++ b/cola/cmds.py @@ -1100,7 +1100,7 @@ def prepare_arguments(self): return args, kwargs kwargs['interactive'] = True - kwargs['autosquash'] = True + kwargs['autosquash'] = self.kwargs.get('autosquash', True) kwargs.update(self.kwargs) if self.upstream: