Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git update does not exist? #4

Closed
bladecoding opened this issue Oct 15, 2012 · 9 comments
Closed

Git update does not exist? #4

bladecoding opened this issue Oct 15, 2012 · 9 comments

Comments

@bladecoding
Copy link

https://github.com/aaugustin/trac-github/blob/master/tracext/github.py#L121

Is git update an aliased command? With the default msysgit install that command seems to be missing. Changing it to git fetch works though.

Thank you for the plugin.

@aaugustin
Copy link
Contributor

This line actually calls git remote update. Does that command work on this system?

I don't own any Windows systems, so it's difficult for me to reproduce this issue -- sorry.

@aaugustin
Copy link
Contributor

Also -- trac-github used to call git fetch, but then Trac's timeline didn't display branches correctly.

git remote update creates a real clone, which avoids several nasty issues related to tracking and updating branches.

@bladecoding
Copy link
Author

oops, sorry missed the remote part. For some reason its silently failing then.

Checking procmon it is calling the right commandline. Although for some reason it is calling it 4 times. I don't really know python so not sure how to debug this further.
cmd /c ""c:\program files (x86)\git\cmd\git.cmd" --git-dir=c:\git\Repo.git remote update --prune"

@aaugustin
Copy link
Contributor

This command line looks correct.

What happens if you run it in a shell — ie. you start cmd.exe and run "c:\program files (x86)\git\cmd\git.cmd" --git-dir=c:\git\Repo.git remote update --prune ?

@bladecoding
Copy link
Author

Its runs correctly. It says "Fetching origin", grabs the changes and then exits.

@aaugustin
Copy link
Contributor

If I understand correctly, trac-github is calling the right command line, and that command line works as expected. So... where's the problem? :)

Here's how to debug this further:

  • enable logging in Trac, and set the log level to DEBUG: http://trac.edgewall.org/wiki/TracLogging
  • go to Admin > Service Hooks > WebHook URLs on GitHub and press "Test Hook"
  • grab the logs created by this request

@bladecoding
Copy link
Author

This is all the debug log says.

2012-10-15 16:04:37,944 Trac[main] DEBUG: Dispatching <Request "POST '/github'">
2012-10-15 16:04:38,092 Trac[git_fs] INFO: detected GIT version 1.7.11.msysgit.0
2012-10-15 16:04:38,092 Trac[svn_fs] DEBUG: Subversion bindings imported
2012-10-15 16:04:38,092 Trac[pygit] DEBUG: requested weak PyGIT.Storage instance 86143824 for 'c:\git\Repo.git'
2012-10-15 16:04:38,092 Trac[git_fs] DEBUG: disabled CachedRepository for 'c:\git\Repo.git'

Also before I did add some logging to track it down to the update line. It executes up to that line but nothing after it.

@aaugustin
Copy link
Contributor

Ah, now I understand.

I'd say that when the Python process calls git, it gets stuck somewhere, and hangs forever. Hence the "update" line never returns and there are no logs.

As you've seen in the code, I'm using the repos object provided by Trac and calling repos.git.repo.remote('update', '--prune'), where repos.git.repo is a GitCore instance. The code probably hangs in GitCore.__execute.

Does my theory match what you're seeing? If it does, I'd say this is a bug in PyGIT, which is rather outside my area of expertise. Since PyGIT is shipped with Trac, I'd suggest reporting the bug to its authors.

@bladecoding
Copy link
Author

Yup that sounds about right. Just checked the process list and there is about 50+ git/cmd/ssh processes. I wonder if there is a way to get the output from them. Anyways, thank you for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants