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

Re: process committed files in post-receive hook

From
Ivan Heffner <iheffner@gmail.com>
Date
Dec 10, 2011, 12:06 UTC
Message-ID
<CAF_oF=yHGFs0TiXkbdoNFxXk2w8TcKSoYx2ZkiOQyYzgYHmxSQ@mail.gmail.com>
In-Reply-To
<4EE340D2.200@elegosoft.com>
On Sat, Dec 10, 2011 at 3:21 AM, Michael Schubert <mschub@elegosoft.com> wrote:
Show 7 quoted lines
> On 12/10/2011 11:29 AM, Hao wrote:
>> I am writing a post-receive hook in Python that examines the content of some
>> files (the HEAD rev). Because the repo is a bare one on the server. My current
>> approach is to check out a working copy on the server and run 'git pull' in post-
>> receive to get the most up-to-date version, and then process files in the
>> working copy.
>

You can actually use a combination of git ls-files and git cat-file -p in order to list and look at te content of files on the remote without checking out an entire working tree.

Previous: Michael SchubertNext: Alexey Shumkin
Message 3 of 8 in “process committed files in post-receive hook”
  1. HaoDec 10, 2011
  2. Michael SchubertDec 10, 2011
  3. Ivan HeffnerDec 10, 2011
  4. Alexey ShumkinDec 10, 2011
  5. Neal KreitzingerDec 15, 2011
  6. Hao WangDec 15, 2011
  7. Jeff KingDec 15, 2011
  8. Hao WangDec 15, 2011

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.