{"thread":{"id":"21944","subject":"on-any-overwrite hook, filename for smudge filter?","startedAt":"2009-12-13T17:55:54Z","lastAt":"2009-12-13T17:55:54Z","messageCount":1,"participants":["Moe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"129812","messageId":"4B252AAA.2070203@signalbeam.net","threadId":"21944","inReplyTo":null,"subject":"on-any-overwrite hook, filename for smudge filter?","fromName":"Moe","fromEmail":"moe@signalbeam.net","sentAt":"2009-12-13T17:55:54Z","receivedAt":"2009-12-13T17:55:54Z","isPatch":false,"sender":{"key":"moe@signalbeam.net","avatar":null},"body":"Hello git family.\n\nI'm looking for a way to reliably preserve permissions in a repository.\n\nI found the excellent metastore-utility[1] (which also backs etckeeper),\nbut it hooks into git-pull and can miss file overwrites caused by other\noperations.\n\nThe closest I found to a global \"on-any-file-overwrite\" hook would be\nthe \"smudge\" filter-command as described in gitattributes(5).\n\nUnfortunately the smudge-command seems to never learn\nabout a filename but merely filters stdin -> stdout.\n\nThe regular hooks don't cut it either, as for example the git-merge\nhook doesn't run on partial merges (\"XXX needs update\").\n\nSo, is there a way to run a script after git has\noverwritten any local file for any reason?\n\n\nBest, Moe\n\n[1] http://git.hardeman.nu/?p=metastore.git\n"}]}