git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bug? Python traceback on git push

From
Jeff King <peff@peff.net>
Date
May 31, 2012, 01:08 UTC
Message-ID
<20120531010820.GB5488@sigill.intra.peff.net>
In-Reply-To
<CA+u+8CLcUtTCkWN2bZvR8JNmgnCoX+TwRK3_e64zWaV__jOo7A@mail.gmail.com>
On Wed, May 30, 2012 at 07:11:38PM -0300, Pedro Werneck wrote:
Show 5 quoted lines
> git 1.7.9.5
> 
> I was pushing to a repository
> 
> push actually seems to have worked, but popped this weird python traceback

Not a bug in git. There is no python code at all in the push code path (the only python in git these days is in the experimental svn remote-helper). However, the remote side may have a hook that is written in python...

Show 9 quoted lines
> remote: Traceback (most recent call last):
> remote:   File "/opt/python/domains/bitbucket.org/current/bitbucket/scripts/git/hooks/pre-receive",
> line 9, in <module>
> remote:     from bitbucket.apps.repo2.hooks import prehooks
> [...]
> remote: ImportError: No module named mercurial.lock
> To git@bitbucket.org:titansgroup/tcf-api.git
>  ! [remote rejected] master -> master (pre-receive hook declined)
> error: failed to push some refs to 'git@bitbucket.org:titansgroup/tcf-api.git'

...and that is exactly what happened. Bitbucket's custom python hook failed, and git did not allow the push to go through.

> (tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git pull
> Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to
> the list of known hosts.
> Already up-to-date.

I don't know that this shows anything conclusive; depending on your configuration, you may or may not be pulling from the same ref you were trying to push to a moment ago.

Show 11 quoted lines
> (tcf-env)werneck@werneck:~/devel/tcf-api/src/tcf$ git push
> Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to
> the list of known hosts.
> Counting objects: 15, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (8/8), done.
> Writing objects: 100% (8/8), 860 bytes, done.
> Total 8 (delta 7), reused 0 (delta 0)
> remote: bb/acl: pjwerneck is allowed. accepted payload.
> To git@bitbucket.org:titansgroup/tcf-api.git
>    16b3b54..a50f671  master -> master

And here you repeat the push, and you see that we had to send the data again (because the push did not go through last time). No clue why their hook failed the first time but not the second.

So as far as I can tell, git is operating as advertised. You might want to file a report with bitbucket about their hook failing.

-Peff
Previous: Pedro Werneck
Message 2 of 2 in “bug? Python traceback on git push”
  1. Pedro WerneckMay 30, 2012
  2. Jeff KingMay 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.