Closed xiejingf closed 2 years ago
I am sure that the whole one line title can be sent to git using push-options, see test case:
Please check the code of "proc-receive" hook. May be only part of the title is sent to merge-request API.
It's wrong to add backslash before double quote characters. Please use --title "..."
instead of --tiltle \"...\"
.
after some tests, I finally get it work. My script use expect programe to spawn a process
the code below does not work as expected
/usr/bin/expect <<-EOF
set time 10
spawn git pr --no-edit --reviewers $REVER --title "$DESC"
expect {
"*(y/N)?" { send "y\r"; exp_continue }
"*did you forget to amend?)" { send "y\r" }
}
use curly brackets ({}
) to make the content inside {}
passed as a whole
/usr/bin/expect <<-EOF
set time 10
spawn git pr --no-edit --reviewers $REVER --title {$DESC}
expect {
"*(y/N)?" { send "y\r"; exp_continue }
"*did you forget to amend?)" { send "y\r" }
}
similar issue in stackoverflow : https://stackoverflow.com/questions/12518354/use-expect-to-spawn-command-with-arguments-containing-spaces
git pr will truncate the shell variable if the variable contains whitespace characters.
I have double checked the value expansion expression, it seems correct, so there must be something wrong during the processing of git pr