From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabian Ruch Subject: [PATCH RFC v2 19/19] rebase -i: Enable options --signoff, --reset-author for pick, reword Date: Wed, 2 Jul 2014 19:48:11 +0200 Message-ID: References: <53A258D2.7080806@gmail.com> Cc: Michael Haggerty , Thomas Rast , Jeff King To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Wed Jul 02 19:50:42 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X2Og2-0007DT-Vb for gcvg-git-2@plane.gmane.org; Wed, 02 Jul 2014 19:50:39 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbaGBRuS (ORCPT ); Wed, 2 Jul 2014 13:50:18 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:53240 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932318AbaGBRuO (ORCPT ); Wed, 2 Jul 2014 13:50:14 -0400 Received: by mail-we0-f173.google.com with SMTP id t60so11697428wes.18 for ; Wed, 02 Jul 2014 10:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+IK+Vn3fwOIf2+UG3cqjzLIVxmtgc3k6swcSY/4XyiY=; b=p8ENAZKhDoVijo3JdptStFTH/JP+InvmdoGUqBWewB51aMmgxOUhbsvKK7Z1ugP3qH dC1v9pJrnwlk2Zfbz6+Q4+RGdbX8qiVHHAjA0aH7/uv/4nTK8sKO64Ryv3wm2fvpG+bc Lyhq6NtU9X+9hpez1Po+WRW9hQnu80na3oR0M5SRyvdB16t0tE36ckkfslH48L59qSaM zl/R9EKub329jNvOKkb8vnlyCXgfAGLLi9nL7MyRKDiIVPyXK6ESLoESOxLaJUMkGu8R GZhtsohhL9OsjQLKX4a7UZ+N/YxYvTsiZRB+YPc0IZMFlDu4mGqiGtQ6hq08MDq7zYrx cVIA== X-Received: by 10.194.92.177 with SMTP id cn17mr62245606wjb.71.1404323413176; Wed, 02 Jul 2014 10:50:13 -0700 (PDT) Received: from puffy.de (nat-wh-nan.rz.uni-karlsruhe.de. [141.70.81.135]) by mx.google.com with ESMTPSA id eo4sm57503504wid.4.2014.07.02.10.50.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 10:50:12 -0700 (PDT) X-Mailer: git-send-email 2.0.0 In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: pick and reword are atomic to-do list commands in the sense that they open a new task which is closed after the respective command is completed. squash and fixup are not atomic. They create a new task which is not completed until the last squash or fixup is processed. Lift the general unknown option blockade for the pick and reword commands. If `do_cmd` comes across one of the options `--signoff` and `--reset-author` while parsing a to-do entry and the scheduled command is either `pick` or `reword`, relay the option to `do_pick`. The `do_pick` options `--gpg-sign` and `--file` are not yet supported because `do_cmd` cannot handle option arguments and options with spaces at the moment. It is true that edit is one of the atomic commands but it displays hash information when the rebase is stopped and some options rewrite the picked commit which alters that information. squash and fixup still do not accept user options as the interplay of `--reset-author` and the author script are yet to be determined. Signed-off-by: Fabian Ruch --- git-rebase--interactive.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index bb258bb..c34a9a7 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -624,6 +624,16 @@ do_replay () { while test $# -gt 0 do case "$1" in + --signoff|--reset-author) + case "$command" in + pick|reword) + ;; + *) + warn "Unsupported option: $1" + command=unknown + ;; + esac + ;; -*) warn "Unknown option: $1" command=unknown @@ -644,21 +654,24 @@ do_replay () { comment_for_reflog pick mark_action_done - do_pick $sha1 || die_with_patch $sha1 "Could not apply $sha1... $rest" + eval do_pick $opts $sha1 \ + || die_with_patch $sha1 "Could not apply $sha1... $rest" record_in_rewritten $sha1 ;; reword|r) comment_for_reflog reword mark_action_done - do_pick --edit $sha1 || die_with_patch $sha1 "Could not apply $sha1... $rest" + eval do_pick --edit $opts $sha1 \ + || die_with_patch $sha1 "Could not apply $sha1... $rest" record_in_rewritten $sha1 ;; edit|e) comment_for_reflog edit mark_action_done - do_pick $sha1 || die_with_patch $sha1 "Could not apply $sha1... $rest" + eval do_pick $opts $sha1 \ + || die_with_patch $sha1 "Could not apply $sha1... $rest" warn "Stopped at $sha1... $rest" exit_with_patch $sha1 0 ;; -- 2.0.0