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

Re: filter-branch ignoring gitattributes?

From
Nnorbert.nemec <norbert.nemec@native-instruments.de>
Date
Feb 8, 2012, 08:23 UTC
Message-ID
<jgtbdh$ahf$1@dough.gmane.org>
In-Reply-To
<jgglh9$mrv$1@dough.gmane.org>
Meanwhile, I can answer my own question:

The "text" attribute works similar to a filter. As with filters in general, it is only applied when git detects a modification in the file. A file change is detected by the file modification time on disc. To reread all files from disk and re-apply the filters to all of them, you would typically delete the .git/index file. In filter-branch, this is not possible, so instead you have to "touch" all files in the --tree-filter command.

Am 03.02.12 13:55, schrieb norbert.nemec:
Show 19 quoted lines
> Hi there,
>
> it seems that 'git filter-branch' ignores the setting in
> .git/info/attributes - is that correct?
>
> Does .gitattributes work reliably?
>
> Specifically, I tried
>
> git filter-branch \
> --tree-filter 'echo "* text=auto" > .gitattributes' \
> --tag-name-filter cat
> --prune-empty -- --all
>
> It seems to work, but I am not sure whether I missed anything.
>
> Greetings,
> Norbert
>
Previous: norbert.nemec
Message 2 of 2 in “filter-branch ignoring gitattributes?”
  1. norbert.nemecFeb 3, 2012
  2. norbert.nemecFeb 8, 2012

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.