Thread (14 messages) flat view 14 messages, 4 authors, 2016-06-15

Re: [PATCH v2 2/3] rebase -i: Teach "--edit-todo" action

From: Martin von Zweigbergk <hidden>
Date: 2016-06-15 22:54:46
Subsystem: the rest · Maintainer: Linus Torvalds

On Sun, Sep 16, 2012 at 8:17 AM, Andrew Wong [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index fd535b0..da067ec 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -12,7 +12,7 @@ SYNOPSIS
        [<upstream>] [<branch>]
 'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
        --root [<branch>]
-'git rebase' --continue | --skip | --abort
+'git rebase' --continue | --skip | --abort | --edit-todo
I guess you should add --edit-todo to OPTIONS_SPEC in git-rebase.sh as
well. The OPTIONS_SPEC needs another little update too. I have
included a patch at the end of this email that you include in a
re-roll.
+       git_sequence_editor "$todo" ||
+       die_abort "Could not execute editor"
die_abort seems a little harsh -- it will discard the rebase state.
Plain "die" would be better, I think.

Also, if you even need to break the line after the || operator, you
might want to indent the remainder by one tab. This file is quite
consistent in using that style, although I don't know what the
preferred style is in general in git.
quoted hunk ↗ jump to hunk
 git var GIT_COMMITTER_IDENT >/dev/null ||
diff --git a/git-rebase.sh b/git-rebase.sh
index 15da926..e5a289c 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -194,6 +195,10 @@ do
                test $total_argc -eq 2 || usage
                action=${1##--}
                ;;
+       --edit-todo)
+               test $total_argc -eq 2 || usage
+               action=${1##--}
+               ;;
It looks like this could be trivially combined with the previous case
arm, making the match "--continue|--skip|--abort|--edit-todo)".


-->8--
Author: Martin von Zweigbergk [off-list ref]

    rebase usage: subcommands can not be combined with -i

    Since 95135b0 (rebase: stricter check of standalone sub command,
    2011-02-06), git-rebase has not allowed to use -i together with
    e.g. --continue. Yet, when rebase started using OPTIONS_SPEC in
    45e2acf (rebase: define options in OPTIONS_SPEC, 2011-02-28), the
    usage message included

      git-rebase [-i] --continue | --abort | --skip

    Remove the "[-i]" from this line.

    Signed-off-by: Martin von Zweigbergk [off-list ref]
diff --git a/git-rebase.sh b/git-rebase.sh
index 15da926..e6b43a2 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -8,7 +8,7 @@ OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>]
[<upstream>] [<branch>]
 git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>]
-git-rebase [-i] --continue | --abort | --skip
+git-rebase --continue | --abort | --skip
 --
  Available options are
 v,verbose!         display a diffstat of what changed upstream
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help