From: Zbigniew Jędrzejewski-Szmek Date: Thu, 07 Jun 2012 08:25:10 GMT Subject: Re: [PATCHv2] rebase [-i --exec | -ix] ... 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: > 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 > Signed-off-by: Valentin Duperray > Signed-off-by: Franck Jonas > Signed-off-by: Thomas Nguy > Signed-off-by: Huynh Khoi Nguyen Nguyen > Signed-off-by: Matthieu Moy > --- > 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 ] > +'git rebase' [-i | --interactive] [options] [--exec ] [--onto ] > [] [] > -'git rebase' [-i | --interactive] [options] --onto > +'git rebase' [-i | --interactive] [options] [--exec ] --onto > --root [] > 'git rebase' --continue | --skip | --abort > > @@ -210,11 +210,29 @@ rebase.autosquash:: > > OPTIONS > ------- > -:: > - Starting point at which to create the new commits. If the > - --onto option is not specified, the starting point is > - . May be any valid commit, and not just an > - existing branch name. > +-x :: > +--exec :: > + Automatically add "exec" followed by between each commit > + applications. Using this option along with --autosquash adds > + the exec line after the squash/fixeup series only. > + 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 :: --exec :: Append "exec " after each commit application line. 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 :: > + With this option, git rebase takes all commits from , > + that are not in , and transplant them on top of > + . is the starting point at which to create > + the new commits. If the --onto option is not specified, the > + starting point is . May be any valid commit, and > + not just an existing branch name. Shouldn't this chunk be a separate patch? s/transplant/transplants/ -- Zbyszek