Thread (29 messages) 29 messages, 9 authors, 2017-05-16

Re: git rebase regression: cannot pass a shell expression directly to --exec

flat view

From: Jeff King <hidden>
Date: 2017-05-16 16:19:05

On Tue, May 16, 2017 at 12:23:02PM +0200, Johannes Schindelin wrote:
On Mon, 15 May 2017, Eric Rannaud wrote:
quoted
It used to be possible to run a sequence like:

  foo() { echo X; }
  export -f foo
  git rebase --exec foo HEAD~10
It would appear to me that you used a side effect of an implementation
detail: that `git rebase -i` was implemented entirely as a shell script.
I don't think that's true at all. He expected the user-provided "--exec"
command to be run by a shell, which seems like a reasonable thing for
Git to promise (and we already make a similar promise for most
user-provided commands that we run).  What happens in between, be it
shell or C code, doesn't matter, and the conversion away from a shell
script in this case only tickled an existing bad interaction between
"export -f" and Git's run-command code.

See my other replies for the full story.

I don't think this has anything in particular to do with git-rebase,
though. Our solutions are either:

  - declare "export -f" as too tricky for our optimization, and teach
    people about the ";" trick

  - figure out some workaround/fallback to disable the shell-skipping
    optimization in this case

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help