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

Expose ReceivePack to pre/post receive hooks #421

Closed
gitblit opened this issue Aug 12, 2015 · 8 comments
Closed

Expose ReceivePack to pre/post receive hooks #421

gitblit opened this issue Aug 12, 2015 · 8 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 125

JGit provides a ReceivePack in the PreReceiveHook. It would also be nice to have the
ReceivePack available in Gitblit's groovy hooks so that RevCommit can be processed.


Reported by andrejs.jermakovics on 2012-08-30 09:36:56

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

It is easy enough to expose the ReceivePack to Groovy, but I don't quite see its utility.
 Can you give me a code example of what you hope to achieve?

Reported by James.Moger on 2012-08-30 11:57:21

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I'd like to get the pushed commit messages but perhaps there's another way of getting
them.

Reported by andrejs.jermakovics on 2012-08-30 15:40:30

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Take a look at:
https://github.com/gitblit/gitblit/blob/master/groovy/sendmail.groovy

Reported by James.Moger on 2012-08-30 15:57:12

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I see, so its using JGitUtils.getRevLog and gitblit.getRepository. Using the ReceivePack
seems a little easier:
    for(ReceiveCommand cmd: commands) {
        RevCommit commit = receivePack.getRevWalk().parseCommit(cmd.getNewId());
    }

Reported by andrejs.jermakovics on 2012-08-31 08:24:42

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Nice example. You convinced me.  I'll push the receive pack to Groovy.

Reported by James.Moger on 2012-08-31 11:40:46

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Reported by James.Moger on 2012-09-10 13:03:09

  • Status changed: Accepted
  • Labels added: Milestone-1.2.0

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Reported by James.Moger on 2012-09-14 13:38:18

  • Status changed: Queued

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

v1.2.0 has been deployed.

Reported by James.Moger on 2013-01-01 01:06:25

  • Status changed: Fixed

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.2.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants