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

Re: Generic filters for git archive?

From
Russ Dill <russ.dill@gmail.com>
Date
Dec 15, 2009, 07:08 UTC
Message-ID
<f9d2a5e10912142308o50c8b9edy63bb485658c93a03@mail.gmail.com>
In-Reply-To
<4B202945.50200@lsrfire.ath.cx>

On Wed, Dec 9, 2009 at 3:48 PM, René Scharfe <rene.scharfe@lsrfire.ath.cx> wrote:

Show 36 quoted lines
> Am 08.12.2009 02:06, schrieb Russ Dill:
>> I'm trying to add copyright headers to my source files as they are
>> exported via git archive. eg:
>>
>> * $Copyright$
>>
>> to
>>
>>  * Copyright (c) 2003-2009 by Foo Bar
>>  *
>>  * This program is free software; you can redistribute it and/or modify it
>>  * under the terms of the GNU General Public License as published by the
>>  * Free Software Foundation; either version 2 of the License, or (at your
>>  * option) any later version.
>>  *
>>  * This program is distributed in the hope that it will be useful, but
>>  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
>>  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>>  * for more details.
>>  *
>>  * You should have received a copy of the GNU General Public License
>>  * along with this program; if not, write to the Free Software Foundation,
>>  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
>>
>> And properly handling things like '# $Copyright$', '// $Copyright$',
>> etc. I have a sed script that does this, but no way to apply it to the
>> output of git archive. I tried setting up a smudge filter that would
>> only smudge output on archive exports, but it doesn't appear that the
>> smudge filters get run on git archive.
>>
>> I am currently running 1.6.3.3
>
> Is the filter attribute contained in a .gitattribute file that's part of
> the tree you are trying to export?  If it's only in the worktree copy,
> then you need to use the option --worktree-attributes to make git
> archive use it.

hmm..It does seem to be running. But I'd really like to use the gitattributes from the tagged version I'm exporting and I don't want the smudge filter to run on files I'm working on in my source tree, just on the export.

Previous: René ScharfeNext: René Scharfe
Message 3 of 4 in “Generic filters for git archive?”
  1. Russ DillDec 8, 2009
  2. René ScharfeDec 9, 2009
  3. Russ DillDec 15, 2009
  4. René ScharfeDec 15, 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.