Discussion:
Missing Change-Id Hint
Marcelo Ávila de Oliveira
2016-05-19 13:41:08 UTC
Permalink
Gerrit always shows the following message when the Change-Id is missing:

...
remote: ERROR: missing Change-Id in commit message footer
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418
***@gerrit.cpqd.com.br:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote: git commit --amend
...

It doesn't matter if the repository was cloned using SSH or HTTPS...

Is this the expected behavior? I thought it should show the "curl" command
for HTTPS clones, shouldn't it?

Thanks & regards.

--
*Marcelo Ávila de Oliveira*
***@cpqd.com.br
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alex Blewitt
2016-05-19 13:56:26 UTC
Permalink
IIRC it only shows the curl command if you have enabled http or https for downloading.
Post by Marcelo Ávila de Oliveira
...
remote: ERROR: missing Change-Id in commit message footer
remote: git commit --amend
...
It doesn't matter if the repository was cloned using SSH or HTTPS...
Is this the expected behavior? I thought it should show the "curl" command for HTTPS clones, shouldn't it?
Thanks & regards.
--
Marcelo Ávila de Oliveira
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en <http://groups.google.com/group/repo-discuss?hl=en>
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcelo Ávila de Oliveira
2016-05-19 14:43:07 UTC
Permalink
Here?

[download]
scheme = http
scheme = ssh

--
*Marcelo Ávila de Oliveira*
Post by Alex Blewitt
IIRC it only shows the curl command if you have enabled http or https for downloading.
...
remote: ERROR: missing Change-Id in commit message footer
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418
remote: git commit --amend
...
It doesn't matter if the repository was cloned using SSH or HTTPS...
Is this the expected behavior? I thought it should show the "curl" command
for HTTPS clones, shouldn't it?
Thanks & regards.
--
*Marcelo Ávila de Oliveira*
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Björn Pedersen' via Repo and Gerrit Discussion
2016-05-19 14:57:36 UTC
Permalink
Hi,

the logic is different in the validator:
If a ssh hostkey exist (== ssh is possible), then display the ssh version,
otherwise use curl.
See
https://gerrit.googlesource.com/gerrit/+/6f018c55598280e8ade09525c09f393f22c24a37/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java#246


The download scheme is only use in the download-command plugin for the the
clone-with-commit-hook command.

Björn
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcelo Ávila de Oliveira
2016-05-19 17:20:05 UTC
Permalink
Ok. What does "if a ssh hostkey exist" mean? I think the only way to solve
this issue is to force a "curl" hint
using gerrit.installCommitMsgHookCommand configuration, correct?

--
*Marcelo Ávila de Oliveira*
***@cpqd.com.br

2016-05-19 11:57 GMT-03:00 'Björn Pedersen' via Repo and Gerrit Discussion <
Post by 'Björn Pedersen' via Repo and Gerrit Discussion
Hi,
If a ssh hostkey exist (== ssh is possible), then display the ssh version,
otherwise use curl.
See
https://gerrit.googlesource.com/gerrit/+/6f018c55598280e8ade09525c09f393f22c24a37/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java#246
The download scheme is only use in the download-command plugin for the
the clone-with-commit-hook command.
Björn
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Björn Pedersen' via Repo and Gerrit Discussion
2016-05-20 06:56:41 UTC
Permalink
If gerrit finds a ssh host key (normal place is
/etc/ssh/ssh_host_<rsa/dsa>key) and has ssh generally enabled, then the ssh
download is offered.
Possibly the check is not the optimal solution, but at this place gerrit
can not depend on the presence of the download-command plugin.


Björn

Am Donnerstag, 19. Mai 2016 19:20:39 UTC+2 schrieb Marcelo Ávila de
Post by Marcelo Ávila de Oliveira
Ok. What does "if a ssh hostkey exist" mean? I think the only way to solve
this issue is to force a "curl" hint
using gerrit.installCommitMsgHookCommand configuration, correct?
--
*Marcelo Ávila de Oliveira*
2016-05-19 11:57 GMT-03:00 'Björn Pedersen' via Repo and Gerrit Discussion
Post by 'Björn Pedersen' via Repo and Gerrit Discussion
Hi,
If a ssh hostkey exist (== ssh is possible), then display the ssh
version, otherwise use curl.
See
https://gerrit.googlesource.com/gerrit/+/6f018c55598280e8ade09525c09f393f22c24a37/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java#246
The download scheme is only use in the download-command plugin for the
the clone-with-commit-hook command.
Björn
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcelo Ávila de Oliveira
2016-05-20 12:58:56 UTC
Permalink
I set in etc/gerrit.config:

[gerrit]
installCommitMsgHookCommand = "gitdir=$(git rev-parse --git-dir); curl
--create-dirs -Lo ${gitdir}/hooks/commit-msg
https://gerrit.cpqd.com.br/tools/hooks/commit-msg; chmod u+x
${gitdir}/hooks/commit-msg"

Now the missing Change-Id hint is:

remote: ERROR: missing Change-Id in commit message footer
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); curl --create-dirs -Lo
${gitdir}/hooks/commit-msg https://gerrit.cpqd.com.br/tools/hooks/commit-msg;
chmod u+x ${gitdir}/hooks/commit-msg
remote: And then amend the commit:
remote: git commit --amend

Which will work regardless the user ssh key is set or not.

Thanks.

--
*Marcelo Ávila de Oliveira*
***@cpqd.com.br

2016-05-20 3:56 GMT-03:00 'Björn Pedersen' via Repo and Gerrit Discussion <
Post by 'Björn Pedersen' via Repo and Gerrit Discussion
If gerrit finds a ssh host key (normal place is
/etc/ssh/ssh_host_<rsa/dsa>key) and has ssh generally enabled, then the ssh
download is offered.
Possibly the check is not the optimal solution, but at this place gerrit
can not depend on the presence of the download-command plugin.
Björn
Am Donnerstag, 19. Mai 2016 19:20:39 UTC+2 schrieb Marcelo Ávila de
Post by Marcelo Ávila de Oliveira
Ok. What does "if a ssh hostkey exist" mean? I think the only way to
solve this issue is to force a "curl" hint
using gerrit.installCommitMsgHookCommand configuration, correct?
--
*Marcelo Ávila de Oliveira*
2016-05-19 11:57 GMT-03:00 'Björn Pedersen' via Repo and Gerrit
Post by 'Björn Pedersen' via Repo and Gerrit Discussion
Hi,
If a ssh hostkey exist (== ssh is possible), then display the ssh
version, otherwise use curl.
See
https://gerrit.googlesource.com/gerrit/+/6f018c55598280e8ade09525c09f393f22c24a37/gerrit-server/src/main/java/com/google/gerrit/server/git/validators/CommitValidators.java#246
The download scheme is only use in the download-command plugin for the
the clone-with-commit-hook command.
Björn
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google
Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
--
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups
"Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...