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 updates have fatal error on git mirrored repos #10

Closed
cjfields opened this issue Apr 4, 2011 · 5 comments
Closed

Git updates have fatal error on git mirrored repos #10

cjfields opened this issue Apr 4, 2011 · 5 comments

Comments

@cjfields
Copy link

cjfields commented Apr 4, 2011

Recent versions of git allow one to create true mirrored repos using the --mirror option. However, using a git reset --soft refs/remotes/origin/master command is fatal (which is the method the github hook uses to update the repo). It appears to be a minor issue, as the prior call to git (a simple git fetch) works, but the error as reported before isn't caught.

Unsure of a fix beyond checking for the git version prior to the git reset --soft call.

@cjfields
Copy link
Author

cjfields commented Apr 4, 2011

Forgot to mention, version of git is 1.7.2.2. Note in the below log output the first command doesn't generate any output, but the second one does:

Processing GithubHookController#index (for 207.97.227.233 at 2011-04-04 15:47:27) [POST]
  Parameters: {"project_id"=>"bioperl", "payload"=>"{\"ref\":\"refs/heads/master\",\"created\":false,\"commits\":[{\"author\":{\"username\":\"cjfields\",\"email\":\"cjfields@bioperl.org\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-03T20:38:46-07:00\",\"modified\":[\"README\"],\"distinct\":true,\"url\":\"https://github.com/bioperl/bioperl-live/commit/983fb37a89be22476b0e4e3880dfb9891bf812b1\",\"message\":\"test hook\",\"added\":[],\"removed\":[],\"id\":\"983fb37a89be22476b0e4e3880dfb9891bf812b1\"},{\"author\":{\"username\":\"cjfields\",\"email\":\"cjfields@bioperl.org\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-03T20:47:22-07:00\",\"modified\":[\"README\"],\"distinct\":true,\"url\":\"https://github.com/bioperl/bioperl-live/commit/5e4f1516b6a4541d6dc3481427101cdffd94dfc7\",\"message\":\"test hook\",\"added\":[],\"removed\":[],\"id\":\"5e4f1516b6a4541d6dc3481427101cdffd94dfc7\"},{\"author\":{\"username\":\"cjfields\",\"email\":\"cjfields@bioperl.org\",\"name\":\"Chris Fields\"},\"timestamp\":\"2011-04-04T07:19:56-07:00\",\"modified\":[\"Bio/Tools/SeqStats.pm\",\"t/SeqTools/SeqStats.t\"],\"distinct\":true,\"url\":\"https://github.com/bioperl/bioperl-live/commit/536fd500d3cd308938513279d755d418ea86e0d5\",\"message\":\"use residue count for calcs instead of length, fixes bug #3185\",\"added\":[],\"removed\":[],\"id\":\"536fd500d3cd308938513279d755d418ea86e0d5\"}],\"repository\":{\"has_downloads\":true,\"url\":\"https://github.com/bioperl/bioperl-live\",\"watchers\":56,\"description\":\"Core BioPerl code\",\"fork\":false,\"forks\":21,\"has_wiki\":false,\"private\":false,\"size\":13584,\"pushed_at\":\"2011/04/04 07:19:59 -0700\",\"created_at\":\"2010/05/12 10:13:10 -0700\",\"language\":\"Perl\",\"has_issues\":false,\"owner\":{\"email\":\"bioperl-guts-l@bioperl.org\",\"name\":\"bioperl\"},\"name\":\"bioperl-live\",\"organization\":\"bioperl\",\"open_issues\":1,\"homepage\":\"http://bioperl.org\"},\"base_ref\":null,\"before\":\"13813c2b5e8c5c825940a82f62e7c8715fc70f9b\",\"pusher\":{\"name\":\"none\"},\"after\":\"536fd500d3cd308938513279d755d418ea86e0d5\",\"deleted\":false,\"forced\":false,\"compare\":\"https://github.com/bioperl/bioperl-live/compare/13813c2...536fd50\"}", "action"=>"index", "controller"=>"github_hook"}
GithubHook: Command output: []
GithubHook: Command output: ["fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.\n", "Use '--' to separate paths from revisions\n"]
Completed in 240ms (View: 1, DB: 95) | 200 OK [https://redmine.open-bio.org/github_hook]

@koppen
Copy link
Owner

koppen commented Apr 4, 2011

Could you give this command a shot and see it'll work:

git fetch origin '+refs/heads/*:refs/heads/*'

It's taken from #8 which might fix your issue. I'd appreciate it if you could try to patch your plugin and verify that pull request

@cjfields
Copy link
Author

cjfields commented Apr 4, 2011

This seems to work, but I'm not sure how backwards-compatible it is. A simple 'git fetch' worked just as well (note the update at the bottom of this page).

@koppen
Copy link
Owner

koppen commented Apr 5, 2011

Great, thanks. I've pushed the above fetch change plus better (well, actual) handling of git errors to the git_errors branch. Could you give that branch a shot on your Redmine and see if it fixes both your issues, please, before I merge to master.

As for backwards compatibility it works on my machine with git 1.5.

@cjfields
Copy link
Author

cjfields commented Apr 5, 2011

That works; I'll close this out. Thanks!

@cjfields cjfields closed this as completed Apr 5, 2011
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