Re: Git tag: pre-receive hook issue

2015-07-22 Thread Jakub Narębski
On 2015-07-19, Jacob Keller wrote: > git describe will tell you if the commit you're passing it is > associated with an annotated tag. I do not understand who this > information can help you implement any policy, so understanding what > the policy you want is would be the most helpful. One policy

Re: Git tag: pre-receive hook issue

2015-07-20 Thread Keller, Jacob E
On Mon, 2015-07-20 at 13:13 +0530, Gaurav Chhabra wrote: > Hi Jake, > > Thanks about the refs/tags check. I’m aware about this. Junio also > explained it in one of his replies. I was actually confused why my > current code was working in past for few of the annotated tags. > Anyways, now that I ha

Re: Git tag: pre-receive hook issue

2015-07-20 Thread Gaurav Chhabra
Hi Jake, Thanks about the refs/tags check. I’m aware about this. Junio also explained it in one of his replies. I was actually confused why my current code was working in past for few of the annotated tags. Anyways, now that I have clarity about the mistake in the code, I guess, I’ll figure it out

Re: Git tag: pre-receive hook issue

2015-07-19 Thread Jacob Keller
To check whether the ref being updated is a tag, you need to check the 3rd parameter. pre-receive receives in the format so you need to check each line's 3rd value which is the ref-name being updated. If it's in refs/tags then it's a tag update. If it's not, you can check it as a branch update

Re: Git tag: pre-receive hook issue

2015-07-19 Thread Gaurav Chhabra
The only thing we wanted to check was whether a ref is a tag. :) Rest other things are working fine (except for the "commits=$new_sha1" thing which Junio already pointed out and corrected). I will correct the pre-receive hook. The only mystery that remains is about the current nonsensical code wor

Re: Git tag: pre-receive hook issue

2015-07-19 Thread Jacob Keller
On Sun, Jul 19, 2015 at 12:55 AM, Gaurav Chhabra wrote: > @Junio: So from your detailed explanation (and Jake's comment), i > understand that since my ref wasn't updated on remote so querying the > same using "git describe" resulted in failure, and hence, code was not > entering the IF block. Corr

Re: Git tag: pre-receive hook issue

2015-07-19 Thread Gaurav Chhabra
@Junio: So from your detailed explanation (and Jake's comment), i understand that since my ref wasn't updated on remote so querying the same using "git describe" resulted in failure, and hence, code was not entering the IF block. Correct? Also, while i was reading your replies, i was just thinking

Re: Git tag: pre-receive hook issue

2015-07-18 Thread Jacob Keller
On Sat, Jul 18, 2015 at 1:08 PM, Gaurav Chhabra wrote: > Thanks for the comments Junio/Jacob! Actually, the script was written > by someone before i came and the tag check was also done by my > colleague recently. I was also trying to implement the tag check > (using refs/tags which i did saw in f

Re: Git tag: pre-receive hook issue

2015-07-18 Thread Junio C Hamano
Gaurav Chhabra writes: > @Junio: From the example you gave, i could conclude the following: > > 1) : gitster garbage/master; git commit --allow-empty -m third > [master d1f1360] third > : gitster garbage/master; git describe --exact-match HEAD ;# third > fatal: no tag exactly matches 'd1f13

Re: Git tag: pre-receive hook issue

2015-07-18 Thread Gaurav Chhabra
Thanks for the comments Junio/Jacob! Actually, the script was written by someone before i came and the tag check was also done by my colleague recently. I was also trying to implement the tag check (using refs/tags which i did saw in few links online) but since my colleague implemented this 'git de

Re: Git tag: pre-receive hook issue

2015-07-17 Thread Jacob Keller
On Fri, Jul 17, 2015 at 11:58 AM, Garbageyard wrote: > We have a pre-receive hook that checks for JIRA ID whenever someone pushes > code to Git server. I'm trying to avoid this check when someone is applying > a tag. Here's the link for the script: http://pastebin.com/VnMQp5ar > > This is the link

Re: Git tag: pre-receive hook issue

2015-07-17 Thread Junio C Hamano
Garbageyard writes: > We have a pre-receive hook that checks for JIRA ID whenever someone pushes > code to Git server. I'm trying to avoid this check when someone is applying > a tag. Here's the link for the script: http://pastebin.com/VnMQp5ar > > This is the link for output: http://pastebin.com