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

2 messages from 2010-06-28 to 2010-06-28. Participants: Mahesh Vaidya, Shawn O. Pearce.
Thread: https://gitlist.dev/t/24220

## Mahesh Vaidya, 2010-06-28 17:55

Subject: pre-receive - 1st push / rev-list didn't work
Message-ID: <AANLkTikGtbfcHCUXm7aVljj_Opb3blKWC0dzfq_HiV8-@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikGtbfcHCUXm7aVljj_Opb3blKWC0dzfq_HiV8-%40mail.gmail.com

```
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, 2010-06-28 18:03

Subject: Re: pre-receive - 1st push / rev-list didn't work
Message-ID: <20100628180324.GD2337@spearce.org>
URL: https://gitlist.dev/e/20100628180324.GD2337%40spearce.org
In-Reply-To: <AANLkTikGtbfcHCUXm7aVljj_Opb3blKWC0dzfq_HiV8-@mail.gmail.com>

```
Mahesh Vaidya <forvaidya@gmail.com> wrote:
> 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.

```
