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

post-receive (post-receive.redmine_gitolite.rb) doesn't pass multiple lines through from STDIN #186

Closed
rkeevil opened this Issue May 2, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@rkeevil

rkeevil commented May 2, 2014

If a commit has multiple events, eg.

git add
git commit -m
git tag new_tag
git push --tags origin master

Only one line is passed through to the post-receive.d hooks, even though two are mentioned in gitolites log.

@n-rodriguez n-rodriguez self-assigned this May 3, 2014

@n-rodriguez n-rodriguez added the bug label May 3, 2014

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez May 23, 2014

Member

Are you sure?
I've done some tests and this is what I get :

nicolas@tchoum:~/test$ echo "fdsfsdfsdf" >> toto && git commit -a -m test
[master 4341d43] test
 1 file changed, 1 insertion(+)
nicolas@tchoum:~/test$ git tag new_tag3
nicolas@tchoum:~/test$ git push --tags origin master
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.01 KiB | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
remote: ---
remote: - e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master
remote: - 0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3
...

In Rails log :

Started POST "/githooks/post-receive/redmine/test" for xxx.xxx.xxx.xxx at 2014-05-23 13:55:02 +0200
Processing by GitoliteHooksController#post_receive as */*
  Parameters: {"clear_time"=>"1400846102", "encoded_time"=>"4b6f674015a33e63264fc17d43852bdf397906ec", "refs"=>["e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master", "0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3"], "type"=>"redmine", "projectid"=>"test"}
Completed 200 OK in 46.6ms (ActiveRecord: 27.4ms)

As you can see the refs parameter is an array containing 2 refs :

[
  "e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master", 
  "0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3"
]

In GitoliteHookController :

---
- e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master
- 0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f162,refs/tags/new_tag3

Member

n-rodriguez commented May 23, 2014

Are you sure?
I've done some tests and this is what I get :

nicolas@tchoum:~/test$ echo "fdsfsdfsdf" >> toto && git commit -a -m test
[master 4341d43] test
 1 file changed, 1 insertion(+)
nicolas@tchoum:~/test$ git tag new_tag3
nicolas@tchoum:~/test$ git push --tags origin master
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.01 KiB | 0 bytes/s, done.
Total 12 (delta 4), reused 0 (delta 0)
remote: ---
remote: - e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master
remote: - 0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3
...

In Rails log :

Started POST "/githooks/post-receive/redmine/test" for xxx.xxx.xxx.xxx at 2014-05-23 13:55:02 +0200
Processing by GitoliteHooksController#post_receive as */*
  Parameters: {"clear_time"=>"1400846102", "encoded_time"=>"4b6f674015a33e63264fc17d43852bdf397906ec", "refs"=>["e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master", "0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3"], "type"=>"redmine", "projectid"=>"test"}
Completed 200 OK in 46.6ms (ActiveRecord: 27.4ms)

As you can see the refs parameter is an array containing 2 refs :

[
  "e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master", 
  "0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f16267,refs/tags/new_tag3"
]

In GitoliteHookController :

---
- e3b106fd8a6d154d0be07fe21efc3d7c637ff207,4341d43950edf9a9e0891d785f5588a988f16267,refs/heads/master
- 0000000000000000000000000000000000000000,4341d43950edf9a9e0891d785f5588a988f162,refs/tags/new_tag3

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez May 23, 2014

Member

Ok! I see!

Member

n-rodriguez commented May 23, 2014

Ok! I see!

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez May 23, 2014

Member

Thanks for your feedback!

Member

n-rodriguez commented May 23, 2014

Thanks for your feedback!

n-rodriguez added a commit that referenced this issue May 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment