Thread (21 messages) flat view 21 messages, 6 authors, 2016-06-15

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

From: Zbigniew Jędrzejewski-Szmek <hidden>
Date: 2016-06-15 22:54:00

On 06/06/2012 12:34 PM, Lucien Kong wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
Signed-off-by: Valentin Duperray <redacted>
Signed-off-by: Franck Jonas <redacted>
Signed-off-by: Thomas Nguy <redacted>
Signed-off-by: Huynh Khoi Nguyen Nguyen <redacted>
Signed-off-by: Matthieu Moy <redacted>
---
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'?)
+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/ ?
+
+--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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help