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

on-any-overwrite hook, filename for smudge filter?

From
MMoe <moe@signalbeam.net>
Date
Dec 13, 2009, 17:55 UTC
Message-ID
<4B252AAA.2070203@signalbeam.net>
Hello git family.
I'm looking for a way to reliably preserve permissions in a repository.

I found the excellent metastore-utility[1] (which also backs etckeeper), but it hooks into git-pull and can miss file overwrites caused by other operations.

The closest I found to a global "on-any-file-overwrite" hook would be the "smudge" filter-command as described in gitattributes(5).

Unfortunately the smudge-command seems to never learn about a filename but merely filters stdin -> stdout.

The regular hooks don't cut it either, as for example the git-merge hook doesn't run on partial merges ("XXX needs update").

So, is there a way to run a script after git has overwritten any local file for any reason?

Best, Moe
[1] http://git.hardeman.nu/?p=metastore.git
Message 1 of 1 in “on-any-overwrite hook, filename for smudge filter?”
  1. MoeDec 13, 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.