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

Re: how-to get commit content with pre-receive hook ?

From
Stefan Beller <sbeller@google.com>
Date
Apr 6, 2017, 18:48 UTC
Message-ID
<CAGZ79kYByeaX0qhRhy0RDq5hvuyEhhDcgWS7GABi6Nr+k-Ekdw@mail.gmail.com>
In-Reply-To
<CACBZZX7xA92e5n=E8fdGHiBHaqzRjP_MVWsaE2v=DcVmCO2r0w@mail.gmail.com>
>>
>> But I don't know how to get the *content* of the file being submitted to run
>> my syntax check rules against it !
>>
>     git log -p <old>..<new>
>     git diff <old>..<new>
or in case of the tool requiring a full worktree
    mkdir /tmp/test
    GIT_WORKTREE=/tmp/test git checkout -f <new>
    and then perform the check on that full tree?
Previous: Ævar Arnfjörð BjarmasonNext: Igor Djordjevic
Message 3 of 4 in “how-to get commit content with pre-receive hook ?”
  1. Eric BelhommeApr 6, 2017
  2. Ævar Arnfjörð BjarmasonApr 6, 2017
  3. Stefan BellerApr 6, 2017
  4. Igor DjordjevicApr 6, 2017

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.