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

Using clean/smudge scripts from repository

From
BBBob Bell <b_git@thebellsplace.com>
Date
Jun 10, 2015, 01:53 UTC
Message-ID
<20150610015349.GA5417@robin.thebellsplace.net>

I'm setting up a clean/smudge filter for a repository. In local testing it seemed to work well. To allow for the clean/smudge scripts to be updated as the source changes, I put the clean/smudge scripts into the repository, and configured the filter in my ~/.gitconfig file to be simply "./filter --clean" and "./filter --smudge".

However, when cloning a fresh repository instance, that's breaking because a file with the filter set by .gitattributes is getting created BEFORE the filter script itself exists.

Playing around with things, I realized that alphabetically the filter script came after the filename being filtered. So I renamed the filter to __filter, and that appears to have changed to order in which contents are created during "git clone".

Is this a proper solution, or did I just "luck out"? Am I perhaps doing something foolish?

Thanks, Bob

Next: Junio C Hamano
Message 1 of 3 in “Using clean/smudge scripts from repository”
  1. Bob BellJun 10, 2015
  2. Junio C HamanoJun 10, 2015
  3. Bob BellJun 10, 2015

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.