Expose ReceivePack to pre/post receive hooks #421

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

Comments

Projects
None yet
2 participants
@gitblit
Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

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

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

Owner

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner

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

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

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

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner

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

  • Status changed: Queued
Owner

gitblit commented Aug 12, 2015

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

  • Status changed: Queued
@gitblit

This comment has been minimized.

Show comment
Hide comment
@gitblit

gitblit Aug 12, 2015

Owner
v1.2.0 has been deployed.

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

  • Status changed: Fixed
Owner

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 Aug 12, 2015

@fzs fzs 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