{"thread":{"id":"24220","subject":"pre-receive - 1st push / rev-list didn't work","startedAt":"2010-06-28T17:55:51Z","lastAt":"2010-06-28T18:03:24Z","messageCount":2,"participants":["Mahesh Vaidya","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"144400","messageId":"AANLkTikGtbfcHCUXm7aVljj_Opb3blKWC0dzfq_HiV8-@mail.gmail.com","threadId":"24220","inReplyTo":null,"subject":"pre-receive - 1st push / rev-list didn't work","fromName":"Mahesh Vaidya","fromEmail":"forvaidya@gmail.com","sentAt":"2010-06-28T17:55:51Z","receivedAt":"2010-06-28T17:55:51Z","isPatch":false,"sender":{"key":"forvaidya@gmail.com","avatar":null},"body":"I am writing pre-receive hooks for commit validation. I use command\n\"git rev-list <from> <to>\" to determine what am I pushing. I can\npossibly pust more than one commit at a time.\n\nIf I am doing 1st ever push ; then <from> becomes \"0\" (40 times). How\ndo I determine what all commits I am pushing i this situations ?\n\nThx. Mahesh\n"},{"id":"144401","messageId":"20100628180324.GD2337@spearce.org","threadId":"24220","inReplyTo":"AANLkTikGtbfcHCUXm7aVljj_Opb3blKWC0dzfq_HiV8-@mail.gmail.com","subject":"Re: pre-receive - 1st push / rev-list didn't work","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-06-28T18:03:24Z","receivedAt":"2010-06-28T18:03:24Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Mahesh Vaidya <forvaidya@gmail.com> wrote:\n> I am writing pre-receive hooks for commit validation. I use command\n> \"git rev-list <from> <to>\" to determine what am I pushing. I can\n> possibly pust more than one commit at a time.\n> \n> If I am doing 1st ever push ; then <from> becomes \"0\" (40 times). How\n> do I determine what all commits I am pushing i this situations ?\n\nYour hook has to detect the 0x40 case and just omit it from the\ncommand line when you run git rev-list.\n\n-- \nShawn.\n"}]}