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

Re: [PATCHv2] rebase [-i --exec | -ix] <CMD>...

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Jun 7, 2012, 08:25 UTC
Message-ID
<4FD06566.5010709@in.waw.pl>
In-Reply-To
<1338978856-26838-1-git-send-email-Lucien.Kong@ensimag.imag.fr>
On 06/06/2012 12:34 PM, Lucien Kong wrote:
Show 58 quoted lines
> This patch provides a way to automatically add these "exec" lines
> between each commit applications. For instance, running 'git rebase -i
> --exec "make test"' lets you check that intermediate commits are
> compilable. It is also compatible with the option --autosquash. At
> this point, you can't use --exec without the interactive mode (-i).
> 
> Tests about this new command are also added in
> t3404-rebase-interactive.sh.
> 
> Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>
> Signed-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr>
> Signed-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr>
> Signed-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr>
> Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
> ---
> The part of --onto in the documentation is changed to be consistent
> with the other options. The exec line, when using the option --autosquash,
> is now only added after the squash/fixup series.
> 
>  Documentation/git-rebase.txt  |   54 +++++++++++++++--
>  git-rebase--interactive.sh    |   19 ++++++
>  git-rebase.sh                 |   20 ++++++-
>  t/t3404-rebase-interactive.sh |  124 +++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 207 insertions(+), 10 deletions(-)
> 
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index 147fa1a..1dd95c4 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -8,9 +8,9 @@ git-rebase - Forward-port local commits to the updated upstream head
>  SYNOPSIS
>  --------
>  [verse]
> -'git rebase' [-i | --interactive] [options] [--onto <newbase>]
> +'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
>  	[<upstream>] [<branch>]
> -'git rebase' [-i | --interactive] [options] --onto <newbase>
> +'git rebase' [-i | --interactive] [options] [--exec <cmd>] --onto <newbase>
>  	--root [<branch>]
>  'git rebase' --continue | --skip | --abort
>  
> @@ -210,11 +210,29 @@ rebase.autosquash::
>  
>  OPTIONS
>  -------
> -<newbase>::
> -	Starting point at which to create the new commits. If the
> -	--onto option is not specified, the starting point is
> -	<upstream>.  May be any valid commit, and not just an
> -	existing branch name.
> +-x <cmd>::
> +--exec <cmd>::
> +	Automatically add "exec" followed by <cmd> between each commit
> +	applications. Using this option along with --autosquash adds
> +	the exec line after the squash/fixeup series only. <cmd>
> +	stands for shell commands. The --exec option has to be
> +	specified. (see INTERACTIVE MODE below)
Hi,
this still doesn't seem right:
- "exec" is added *after* other lines, not *between*
- --exec is not mandatory
Maybe something along these lines:
-x <cmd>::
--exec <cmd>::
  Append "exec <cmd>" after each commit application line. <cmd> will
  be interpreted as one or more shell commands.
  +
  If --autosquash is used, the "exec" lines will not be appended for
  the intermediate commits, and will only appear at the end of each
  squash/fixup series.
> ++
> +This has to be used along with the `--interactive` option explicitly.
This sentence is very unclear. (E.g. is 'this'?)
Show 6 quoted lines
> +You may execute several commands between each commit applications.
> +For this, you can use one instance of exec:
> +	git rebase -i --exec "cmd1; cmd2; ...".
> +You can also insert several instances of exec, if you wish to
> +only have one command per line for example:
> +	git rebase -i --exec "cmd1" --exec "cmd2" ...
s/per line for example/per line. For example/ ?
Show 8 quoted lines
> +
> +--onto <newbase>::
> +	With this option, git rebase takes all commits from <branch>,
> +	that are not in <upstream>, and transplant them on top of
> +	<newbase>. <newbase> is the starting point at which to create
> +	the new commits. If the --onto option is not specified, the
> +	starting point is <upstream>.  May be any valid commit, and
> +	not just an existing branch name.
Shouldn't this chunk be a separate patch?
s/transplant/transplants/

-- Zbyszek

Previous: Junio C HamanoNext: Johannes Sixt
Message 11 of 50 in “rebase [-i --exec | -ix] <CMD>...”
  1. rebase [-i --exec | -ix] <CMD>...Kong Lucien, Jun 4, 2012
  2. Junio C HamanoJun 4, 2012
  3. Matthieu MoyJun 4, 2012
  4. Junio C HamanoJun 4, 2012
  5. konglu@minatec.inpg.frJun 5, 2012
  6. Junio C HamanoJun 5, 2012
  7. Matthieu MoyJun 4, 2012
  8. [PATCHv2] rebase [-i --exec | -ix] <CMD>...Lucien Kong, Jun 6, 2012
  9. Matthieu MoyJun 6, 2012
  10. Junio C HamanoJun 6, 2012
  11. Zbigniew Jędrzejewski-SzmekJun 7, 2012
  12. Johannes SixtJun 7, 2012
  13. konglu@minatec.inpg.frJun 7, 2012
  14. Matthieu MoyJun 7, 2012
  15. 1/2 git-rebase.txt: "--onto" option updatedLucien Kong, Jun 8, 2012
  16. 2/2 rebase [-i --exec | -ix] <CMD>...Lucien Kong, Jun 8, 2012
  17. Johannes SixtJun 8, 2012
  18. Torsten BögershausenJun 8, 2012
  19. konglu@minatec.inpg.frJun 8, 2012
  20. Torsten BögershausenJun 8, 2012
  21. konglu@minatec.inpg.frJun 8, 2012
  22. Torsten BögershausenJun 8, 2012
  23. konglu@minatec.inpg.frJun 8, 2012
  24. Torsten BögershausenJun 9, 2012
  25. konglu@minatec.inpg.frJun 9, 2012
  26. [PATCHv4] rebase [-i --exec | -ix] <CMD>...Lucien Kong, Jun 10, 2012
  27. Johannes SixtJun 10, 2012
  28. Junio C HamanoJun 11, 2012
  29. Johannes SixtJun 12, 2012
  30. Junio C HamanoJun 12, 2012
  31. [PATCHv5] rebase [-i --exec | -ix] <CMD>...Lucien Kong, Jun 12, 2012
  32. Zbigniew Jędrzejewski-SzmekJun 12, 2012
  33. Junio C HamanoJun 12, 2012
  34. Zbigniew Jędrzejewski-SzmekJun 13, 2012
  35. Junio C HamanoJun 13, 2012
  36. konglu@minatec.inpg.frJun 13, 2012
  37. Junio C HamanoJun 13, 2012
  38. konglu@minatec.inpg.frJun 13, 2012
  39. Johannes SixtJun 13, 2012
  40. Zbigniew Jędrzejewski-SzmekJun 13, 2012
  41. Junio C HamanoJun 13, 2012
  42. Junio C HamanoJun 13, 2012
  43. Zbigniew Jędrzejewski-SzmekJun 13, 2012
  44. Matthieu MoyJun 14, 2012
  45. Marc BranchaudJun 14, 2012
  46. Matthieu MoyJun 8, 2012
  47. Junio C HamanoJun 8, 2012
  48. konglu@minatec.inpg.frJun 8, 2012
  49. Junio C HamanoJun 8, 2012
  50. konglu@minatec.inpg.frJun 8, 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.