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

Re: [TopGit PATCH] pre-commit: check .top* files in the to-be-commited tree

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Jun 4, 2009, 05:27 UTC
Message-ID
<20090604052716.GA24414@pengutronix.de>
In-Reply-To
<1243975238-4807-1-git-send-email-bert.wesarg@googlemail.com>
Hi Bert,
On Tue, Jun 02, 2009 at 10:40:38PM +0200, Bert Wesarg wrote:
> We currently check fo these files only in the working tree. But we should check
> what would be commited. We use write-tree to be able to utilize ls-tree and
> check the result.

<nitpick> I prefer not speaking about "us" in the commit log. Better use passive voice. </nitpick> So what about:

The pre-commit hook used to check that the working copy has the .top* files. Instead of that assert that the tree that is about to be commited has these files.

> +# I suspect this can't fail, but who knows
> +tree=$(git write-tree) ||
> +	die "Can't write tree"
Actually you don't need to write the tree.  You can use:
	git cat-file -t :0:.topdeps
	-> blob
	git cat-file blob :0:.topdeps | grep .

Up to now I only shortly looked at your patches, but they seem to be OK. I hope I get around to push the changes later today.

Best regards Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
Previous: Bert WesargNext: Bert Wesarg
Message 2 of 3 in “pre-commit: check .top* files in the to-be-commited tree”
  1. pre-commit: check .top* files in the to-be-commited treeBert Wesarg, Jun 2, 2009
  2. Uwe Kleine-KönigJun 4, 2009
  3. Bert WesargJun 4, 2009

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.