How to create change-id?

Now that I’ve finally managed to build a “Collabora Office classic” build, the next problem has cropped up. My patch requires a change-id. How to generate it?

The command scp -p -P 29418 regina-henschel@gerrit.collaboraoffice.com:hooks/commit-msg .git/hooks/ does not work. I get the message

subsystem request failed on channel 0
scp: Connection closed

I have used the command in Git Bash in folder engine. Using it in folder online does neither work.

hi @Regina

Since OpenSSH 9.0, scp uses the SFTP protocol by default instead of the old “legacy SCP” protocol. Gerrit’s built-in SSH server does not implement an SFTP subsystem, so when your modern scp asks for it, the server refuses:

subsystem request failed on channel 0
scp: Connection closed

Git Bash ships a recent OpenSSH, which is why you hit this.

Fix 1: force the legacy protocol with -O

Add the -O flag (capital letter O, for “old protocol”):

scp -O -p -P 29418 regina-henschel@gerrit.collaboraoffice.com:hooks/commit-msg .git/hooks/

That single flag is almost always all that is needed.

Fix 2: download the hook over HTTPS instead

If -O still gives you trouble, fetch the same hook over HTTPS instead:

curl -Lo .git/hooks/commit-msg https://gerrit.collaboraoffice.com/tools/hooks/commit-msg
chmod +x .git/hooks/commit-msg

Then make the hook stamp your existing commit with a real Change-Id:

git commit --amend --no-edit
git log -1

Either way, make sure the file ends up execut-p preserving mode on the scp.

Yes, that works. Thank you.

The patch is now in https://gerrit.collaboraoffice.com/c/online/+/4396.

1 Like