git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: simple example for git hooks

From
GGelonida <gelonida@gmail.com>
Date
Sep 5, 2010, 21:48 UTC
Message-ID
<i6137p$uet$1@dough.gmane.org>
In-Reply-To
<i5p96s$u7q$1@dough.gmane.org>

Hi everybody, On 09/03/2010 12:41 AM, Gelonida wrote:

Show 16 quoted lines
> Does anyone have a simple example of a git pre-commit hook
> 
> 
> I have difficulties finding understandable tutorals about git hooks.
> 
> 
> 
> 
> What I am looking at is basic examples about
> 
> 
> precommit hooks
> ================
> 
> - how to get list of modified files
> 

Thanks for all your answers. I'm currently using git diff-index HEAD --cached

This seems to do what I was looking for.
Previous: Neal Kreitzinger
Message 6 of 6 in “simple example for git hooks”
  1. GelonidaSep 2, 2010
  2. Ævar Arnfjörð BjarmasonSep 2, 2010
  3. GelonidaSep 2, 2010
  4. Knut FrankeSep 3, 2010
  5. Neal KreitzingerSep 3, 2010
  6. GelonidaSep 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.