Re: Arguments to git hooks
- From
- Marcus Karlsson <mk@acc.umu.se>
- Date
- May 6, 2012, 19:12 UTC
- Message-ID
- <20120506191202.GB5725@moj>
- In-Reply-To
- <CAH-tXsB4PBS_YjW4DCjT6ORmNPomQ8XMPbKx3hxVNH=FyB2u3g@mail.gmail.com>
On Mon, May 07, 2012 at 12:05:51AM +0530, jaseem abid wrote:
Show 11 quoted lines
> Hello all, > > I am trying to write a hook '.git/hooks/commit-msg' to be run before > every commit. > > How can I pass arguments to the script? Now by default the only arg I > am getting is `.git/COMMIT_EDITMSG'`. I would love to get the list of > files I tried to commit also into the script so that I can run a lint > program on it before committing it. How can I get this done? > > V/r,
As far as I can see that's the only argument that git-commit passes on to the commit-msg hook. Can't you just call something like git-status from the hook or do you need the information passed specifically as an argument?
Marcus