unable to push to demo project

463 views
Skip to first unread message

kamadana jaswanth

unread,
Aug 23, 2017, 5:31:55 AM8/23/17
to Repo and Gerrit Discussion
Hi,

I am using the gerrit for the first time. I created a demo project. I am planning to push one text file to the branch (test) for the review. i am facing the following.

/test/testproj/testproj$ git push ssh://us...@192.168.200.78:29418/testproj HEAD:refs/for/test
Counting objects: 4, done.
Writing objects: 100% (3/3), 254 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done   
remote: ERROR: [694b476] 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 user@mcinhvendes21:hooks/commit-msg ${gitdir}/hooks/
remote: And then amend the commit:
remote:   git commit --amend
remote:
To ssh://us...@192.168.200.78:29418/testproj
 ! [remote rejected] HEAD -> refs/for/test ([694b476] missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://us...@192.168.200.78:29418/testproj'
user@(none):~/test/testproj/testproj$


can you please suggest me where i am missing.


Thanks & Regards
Jaswanth

kamal gumparthi

unread,
Aug 23, 2017, 5:40:25 AM8/23/17
to Repo and Gerrit Discussion
Hi ,

Change id is required before pushing any commit. This could be disabled in "Gerrit UI" under "general" tab section. if you dont want but it is recomended to use.
Please install the commit message hook in your local pc.
git is powerful tool and it gives us the hint where is the issue.
scp -p -P 29418 user@mcinhvendes21:hooks/commit-msg ${gitdir}/hooks/
After that try to amend your last commit
git commit --amend 
git push ssh://us...@192.168.200.78:29418/testproj HEAD:refs/for/test


Regards,
sarma

kamadana jaswanth

unread,
Aug 23, 2017, 6:00:22 AM8/23/17
to Repo and Gerrit Discussion
Hi sarma,

If i do scp -p -P 29418 user@mcinhvendes21:hooks/commit-msg ${gitdir}/hooks/

i am getting following error.


/hooks/: Is a directory
protocol error: expected control record


Can you please help me on this.

Thanks & Regards
Jaswanth

kamal gumparthi

unread,
Aug 23, 2017, 6:08:47 AM8/23/17
to Repo and Gerrit Discussion
Take the 2nd part of the command from "clone with commit message hook". You can see the scp command there.
run it in git bash in your home directory but not in repository.
Please let me know how you are executing..screenshot would be helpful

Sven Selberg

unread,
Aug 23, 2017, 7:11:46 AM8/23/17
to kamal gumparthi, Repo and Gerrit Discussion

Hi,


The problem is that you missed the first part​ "gitdir=$(git rev-parse --git-dir)" so "gitdir" is undefined.


Try the full curse:

gitdir=$(git rev-parse --git-dir); scp -p -P 29418 user@mcinhvendes21:hooks/commit-msg ${gitdir}/hooks/

or 

scp -p -P 29418 user@mcinhvendes21:hooks/commit-msg $(git rev-parse --git-dir)/hooks/


/Sven




From: repo-d...@googlegroups.com <repo-d...@googlegroups.com> on behalf of kamal gumparthi <shar...@gmail.com>
Sent: Wednesday, August 23, 2017 12:08 PM
To: Repo and Gerrit Discussion
Subject: Re: unable to push to demo project
 
--
--
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.
Reply all
Reply to author
Forward
0 new messages