git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Martin von Zweigbergk <martinvonz@gmail.com>
Date
Sep 17, 2012, 06:11 UTC
Message-ID
<CANiSa6j2zA5P6yDaR7VU416Bzes6xbWuHbU83=BGN67Wo9j_Cw@mail.gmail.com>
In-Reply-To
<1347808623-1058-2-git-send-email-andrew.kw.w@gmail.com>
On Sun, Sep 16, 2012 at 8:17 AM, Andrew Wong <andrew.kw.w@gmail.com> wrote:
Show 10 quoted lines
> 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.

Show 13 quoted lines
>  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 <martinvonz@gmail.com>
    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 <martinvonz@gmail.com>
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
Previous: Andrew WongNext: Andrew Wong
Message 21 of 34 in “[RFC] Add "edit" action for interactive rebase?”
  1. Andrew WongSep 10, 2012
  2. rebase -i: Teach "--edit" actionAndrew Wong, Sep 10, 2012
  3. Matthieu MoySep 10, 2012
  4. Andrew WongSep 10, 2012
  5. Jeff KingSep 10, 2012
  6. Johannes SixtSep 10, 2012
  7. Jeff KingSep 10, 2012
  8. Andrew WongSep 10, 2012
  9. Junio C HamanoSep 10, 2012
  10. Andrew WongSep 10, 2012
  11. 0/3 rebase -i: Teach "--edit-todo"Andrew Wong, Sep 15, 2012
  12. 1/3 rebase -i: Refactor help messages for todo fileAndrew Wong, Sep 15, 2012
  13. 2/3 rebase -i: Teach "--edit-todo" actionAndrew Wong, Sep 15, 2012
  14. Junio C HamanoSep 16, 2012
  15. Andrew WongSep 16, 2012
  16. Junio C HamanoSep 18, 2012
  17. 3/3 rebase -i: Add tests for "--edit-todo"Andrew Wong, Sep 15, 2012
  18. Junio C HamanoSep 16, 2012
  19. 1/3 rebase -i: Refactor help messages for todo fileAndrew Wong, Sep 16, 2012
  20. 2/3 rebase -i: Teach "--edit-todo" actionAndrew Wong, Sep 16, 2012
  21. Martin von ZweigbergkSep 17, 2012
  22. 0/4 rebase -i: Teach "--edit-todo" actionAndrew Wong, Sep 18, 2012
  23. 1/4 rebase usage: subcommands can not be combined with -iAndrew Wong, Sep 18, 2012
  24. 2/4 rebase -i: Refactor help messages for todo fileAndrew Wong, Sep 18, 2012
  25. 3/4 rebase -i: Teach "--edit-todo" actionAndrew Wong, Sep 18, 2012
  26. 4/4 rebase -i: Add tests for "--edit-todo"Andrew Wong, Sep 18, 2012
  27. Martin von ZweigbergkSep 18, 2012
  28. Andrew WongSep 18, 2012
  29. Martin von ZweigbergkSep 18, 2012
  30. 5/4 rebase -i: suggest using --edit-todo to fix an unknown instructionJohannes Sixt, Sep 19, 2012
  31. Junio C HamanoSep 19, 2012
  32. 3/3 rebase -i: Add tests for "--edit-todo"Andrew Wong, Sep 16, 2012
  33. Johannes SixtSep 10, 2012
  34. Andrew WongSep 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.