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

Re: [PATCHv3 2/2] rebase [-i --exec | -ix] <CMD>...

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 8, 2012, 18:56 UTC
Message-ID
<4FD24AE9.8020101@web.de>
In-Reply-To
<1339167235-2009-2-git-send-email-Lucien.Kong@ensimag.imag.fr>
On 08.06.12 16:53, Lucien Kong wrote:
Show 8 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.
> Should now work on MacOS.

Hej, I'm not sure on which commit to apply the patch. (may be we shoud improve git format-patch to tell us the original commit ID), but if I remove the non applying part, it looks like this:

================= ok 54 - rebase-i history with funny messages

expecting success: 
	git checkout master &&
	git checkout -b execute &&
	test_commit one_exec main.txt one_exec &&
	test_commit two_exec main.txt two_exec &&
	test_commit three_exec main.txt three_exec
Switched to branch 'master'
Switched to a new branch 'execute'
[execute 925b01e] one_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main.txt
[execute 7f87cbe] two_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[execute f0f177e] three_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 55 - prepare for rebase -i --exec
expecting success: 
	git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expected
	) &&
	sed 1,9d expected >expect &&
	mv expect expected &&
	test_cmp expected actual
error: unknown option `exec'
usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
   or: git-rebase [-i] --continue | --abort | --skip
Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue

not ok - 56 running "git rebase -i --exec git show HEAD" # # git rebase -i --exec "git show HEAD" HEAD~2 >actual && # ( # FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" && # export FAKE_LINES && # git rebase -i HEAD~2 >expected # ) && # sed 1,9d expected >expect && # mv expect expected && # test_cmp expected actual #

expecting success: 
	git reset --hard execute &&
	git rebase --exec "git show HEAD" -i HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expected
	) &&
	sed 1,9d expected >expect &&
	mv expect expected &&
	test_cmp expected actual
HEAD is now at f0f177e three_exec
error: unknown option `exec'
usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
   or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
   or: git-rebase [-i] --continue | --abort | --skip
Available options are
    -v, --verbose         display a diffstat of what changed upstream
    -q, --quiet           be quiet. implies --no-stat
    --onto ...            rebase onto given branch instead of upstream
    -p, --preserve-merges
                          try to recreate merges instead of ignoring them
    -s, --strategy ...    use the given merge strategy
    --no-ff               cherry-pick all commits, even if unchanged
    -m, --merge           use merging strategies to rebase
    -i, --interactive     let the user edit the list of commits to rebase
    -k, --keep-empty	     preserve empty commits during rebase
    -f, --force-rebase    force rebase even if branch is up to date
    -X, --strategy-option ...
                          pass the argument through to the merge strategy
    --stat                display a diffstat of what changed upstream
    -n, --no-stat         do not show diffstat of what changed upstream
    --verify              allow pre-rebase hook to run
    --rerere-autoupdate   allow rerere to update index with resolved conflicts
    --root                rebase all reachable commits up to the root(s)
    --autosquash          move commits that begin with squash!/fixup! under -i
    --committer-date-is-author-date
                          passed to 'git am'
    --ignore-date         passed to 'git am'
    --whitespace ...      passed to 'git apply'
    --ignore-whitespace   passed to 'git apply'
    -C ...                passed to 'git apply'
Actions:
    --continue            continue
    --abort               abort and check out the original branch
    --skip                skip current patch and continue
not ok - 57 running "git rebase --exec git show HEAD -i"
Previous: Johannes SixtNext: konglu@minatec.inpg.fr
Message 18 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.