threads / discuss / 24220

pre-receive - 1st push / rev-list didn't work

Subject: pre-receive - 1st push / rev-list didn't work

## tl;dr

2 messages between Jun 28, 2010 and Jun 28, 2010.

replies: 1people: 2as markdown or json

Mahesh Vaidya· Jun 28, 2010, 17:55 UTC · lore

I am writing pre-receive hooks for commit validation. I use command "git rev-list <from> <to>" to determine what am I pushing. I can possibly pust more than one commit at a time.

If I am doing 1st ever push ; then <from> becomes "0" (40 times). How do I determine what all commits I am pushing i this situations ?

Thx. Mahesh
Shawn O. Pearce· Jun 28, 2010, 18:03 UTC · re: Mahesh Vaidya · lore

Re: pre-receive - 1st push / rev-list didn't work

Mahesh Vaidya <forvaidya@gmail.com> wrote:
Show 6 quoted lines
> I am writing pre-receive hooks for commit validation. I use command
> "git rev-list <from> <to>" to determine what am I pushing. I can
> possibly pust more than one commit at a time.
> 
> If I am doing 1st ever push ; then <from> becomes "0" (40 times). How
> do I determine what all commits I am pushing i this situations ?

Your hook has to detect the 0x40 case and just omit it from the command line when you run git rev-list.

-- 
Shawn.

← back to recent threads