#2013 Set description for gitaugeas
Closed: Fixed None Opened 14 years ago by lutter.

= phenomenon =

When I try to push to ssh://git.fedorahosted.org/git/augeas.git I get the error
{{{
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1.15 KiB, done.
Total 4 (delta 3), reused 0 (delta 0)
*** Project description file hasn't been set
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/master
To ssh://git.fedorahosted.org/git/augeas.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://git.fedorahosted.org/git/augeas.git'
}}}

= recommendation =

Please set the description for Augeas to "Configuration parser and editing tool"


done, but I'm not sure that was your problem. tmz can you take a look at this? The update hook that's in here is a little much for me to understand at the moment...

The change you made at least let me push again. Though when I push, there's an error message, the 'fatal:' line; it doesn't seem to harm the push:
{{{
Counting objects: 25, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (16/16), 2.72 KiB, done.
Total 16 (delta 13), reused 0 (delta 0)
fatal: Needed a single revision
To ssh://git.fedorahosted.org/git/augeas.git
7da96e8..15d0c68 master -> master
}}}

That was indeed the first problem. The update hook checks that the description is set and complains if it is not: "*** Project description file hasn't been set."

Now, where the 'fatal: Needed a single revision' is coming from I'm not sure. David, do you have anything else you plan to push soon? If so, I could setup the update hook to temporarily run verbosely (as in set -x in the script). Let me know and we can coordinate things.

(I've got to take care a puppet update for $WORK this evening. If that goes smoothly, I'll be around, otherwise I might have my hands full for a bit.)

I don't have anything right this second, but I am sure I will tomorrow or so. Just do the set -x, I'll attach whatever output I get next time I push to this ticket.

Done. I should hopefully be around all day tomorrow, so ping me on IRC if it gives you any grief.

I just pushed a patch and got this:

{{{
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 802 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
+ refname=refs/heads/master
+ oldrev=15d0c687ada1bfbaa7f54f3164729e61571c2246
+ newrev=420fca95fb760fbe9f33c2034f5103a54f5970e1
+ '[' -z . ']'
+ '[' -z refs/heads/master -o -z 15d0c687ada1bfbaa7f54f3164729e61571c2246 -o -z 420fca95fb760fbe9f33c2034f5103a54f5970e1 ']'
++ git config --bool hooks.allowunannotated
+ allowunannotated=
++ git config --bool hooks.allowdeletebranch
+ allowdeletebranch=
++ git config --bool hooks.denycreatebranch
+ denycreatebranch=
++ git config --bool hooks.allowdeletetag
+ allowdeletetag=
++ sed -e 1q ./description
+ projectdesc='Configuration parser and editing tool'
+ case "$projectdesc" in
+ zero=0000000000000000000000000000000000000000
+ '[' 420fca95fb760fbe9f33c2034f5103a54f5970e1 = 0000000000000000000000000000000000000000 ']'
++ git-cat-file -t 420fca95fb760fbe9f33c2034f5103a54f5970e1
+ newrev_type=commit
+ check_diff=no
+ case "$refname","$newrev_type" in
+ '[' 15d0c687ada1bfbaa7f54f3164729e61571c2246 = 0000000000000000000000000000000000000000 -a '' = true ']'
+ check_diff=yes
+ branch=master
++ git config hooks.denypush.branch.master
+ deny_push_email=
+ case $deny_push_email in
++ git config --bool hooks.denymerge.master
+ deny_merge=true
+ case $deny_merge in
+ is_merge_commit 420fca95fb760fbe9f33c2034f5103a54f5970e1
+ git rev-parse --verify --quiet '420fca95fb760fbe9f33c2034f5103a54f5970e1^2'
fatal: Needed a single revision
+ '[' yes = yes ']'
++ git config --bool hooks.denybadwhitespace
+ denybadwhitespace=true
+ '[' true = true ']'
+ test 15d0c687ada1bfbaa7f54f3164729e61571c2246 = 0000000000000000000000000000000000000000
+ exec git --no-pager diff --check 15d0c687ada1bfbaa7f54f3164729e61571c2246 420fca95fb760fbe9f33c2034f5103a54f5970e1 --
To ssh://git.fedorahosted.org/git/augeas.git
15d0c68..420fca9 master -> master
}}}

I didn't really try and understand what this does, but the '^2' in the git-rev-parse looks a little funny.

I see. In git-1.5.5.6, rev-parse hasn't yet been taught to be quiet when used with verify. That happened in 1.5.6 (well, commit b1b3596 in git.git). We'll just have to redirect stderr for that command to /dev/null, as we don't care about the output.

The ^2 is used in is_merge_commit() to find the second parent of the commit, which should only be true for merge commits. That does work well, though why it's not being called for each ref that is sent on a push is something I haven't yet figured out.

For now, I sent the error output from the rev-parse call to /dev/null. We just need to figure out how to fix it so it actually catches merge commits that aren't the most recent commit and we'll be golden. I've dropped the set -x as well, so your pushes won't be so noisy.

Thanks for you help and patience David.

¹ http://git.kernel.org/?p=git/git.git;a=commit;h=b1b3596

Per some comments in #1948, I just pushed an update to the custom update hook used on fedorahosted. It will propagate via puppet soon and should resolve the issue with allowing merge commits to sneak past the hook.

Login to comment on this ticket.

Metadata