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

Re: [PATCH 1/2 (fix broken test)] rebase -i: add exec command to launch a shell command

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 11, 2010, 18:31 UTC
Message-ID
<7v62zhyp9e.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1281453472-29835-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 15 quoted lines
> The typical usage pattern would be to run a test (or simply a compilation
> command) at given points in history.
>
> The shell command is ran (from the worktree root), and the rebase is
> stopped when the command fails, to give the user an opportunity to fix
> the problem before continuing with "git rebase --continue".
>
> This needs a little rework of skip_unnecessary_picks, which wasn't robust
> enough to deal with lines like
>
>   exec >"file    name with many spaces"
>
> in the todolist. The new version extracts command, sha1 and rest from
> each line, but outputs the line itself verbatim to avoid changing the
> whitespace layout.
Thanks.
Show 13 quoted lines
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 9f03ce6..93b181e 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -64,6 +64,67 @@ test_expect_success 'setup' '
>  	done
>  '
>  
> +# "exec" commands are ran with the user shell by default, but this may
> +# be non-POSIX. For example, if SHELL=zsh then ">file" doesn't work
> +# to create a file. Unseting SHELL avoids such non-portable behavior
> +# in tests.
> +SHELL=
Tricky but true.

Do we have other callouts that we use $SHELL from the environment? execv_shell_cmd() just runs "sh -c" from $PATH so diff (when running external diff) nor ll-merge (when running external merge driver) that call it via run_command_v_opt(RUN_USING_SHELL) are immune to this issue.

Previous: Matthieu MoyNext: Matthieu Moy
Message 8 of 38 in “Black smoke from git rebase -i exec”
  1. Ævar Arnfjörð BjarmasonAug 10, 2010
  2. Matthieu MoyAug 10, 2010
  3. Ævar Arnfjörð BjarmasonAug 10, 2010
  4. Johannes SixtAug 10, 2010
  5. Ævar Arnfjörð BjarmasonAug 10, 2010
  6. Matthieu MoyAug 10, 2010
  7. 1/2 rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 10, 2010
  8. Junio C HamanoAug 11, 2010
  9. Matthieu MoyAug 12, 2010
  10. 0/2 rebase -i: in-editor documentation nitsJonathan Nieder, Jan 16, 2011
  11. 1/2 rebase -i: reword in-editor documentation of "exec"Jonathan Nieder, Jan 16, 2011
  12. Matthieu MoyJan 16, 2011
  13. Junio C HamanoJan 18, 2011
  14. Jonathan NiederJan 20, 2011
  15. Junio C HamanoJan 20, 2011
  16. 1/2 rebase -i: clarify in-editor documentation of "exec"Jonathan Nieder, Jan 21, 2011
  17. Matthieu MoyJan 21, 2011
  18. Jonathan NiederJan 21, 2011
  19. Matthieu MoyJan 21, 2011
  20. 2/2 rebase -i: explain how to discard all commitsJonathan Nieder, Jan 16, 2011
  21. 2/2 Re: rebase -i: explain how to discard all commitsNicolas Sebrecht, Jan 20, 2011
  22. Jonathan NiederJan 20, 2011
  23. 2/2 Re: rebase -i: explain how to discard all commitsNicolas Sebrecht, Jan 20, 2011
  24. Thomas RastJan 20, 2011
  25. Junio C HamanoJan 20, 2011
  26. Johannes SchindelinJan 21, 2011
  27. Documentation: suggest "reset --keep" to undo a commitJonathan Nieder, Jan 21, 2011
  28. Junio C HamanoJan 21, 2011
  29. Jonathan NiederJan 21, 2011
  30. Junio C HamanoJan 21, 2011
  31. Junio C HamanoJan 21, 2011
  32. Matthieu MoyJan 21, 2011
  33. Joshua JensenJan 21, 2011
  34. Documentation: do not treat reset --keep as a special caseJonathan Nieder, Jan 21, 2011
  35. Junio C HamanoJan 21, 2011
  36. Jay SoffianJan 26, 2011
  37. Johannes SchindelinJan 23, 2011
  38. 2/2 test-lib: user-friendly alternatives to test [-d|-f|-e]Matthieu Moy, Aug 10, 2010

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.