From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Russ Dill <russ.dill@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Generic filters for git archive?
Date: Tue, 15 Dec 2009 14:06:54 +0100 [thread overview]
Message-ID: <4B2789EE.1030104@lsrfire.ath.cx> (raw)
In-Reply-To: <f9d2a5e10912142308o50c8b9edy63bb485658c93a03@mail.gmail.com>
Am 15.12.2009 08:08, schrieb Russ Dill:
> 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.
This seems to work here:
$ git version
git version 1.6.3.3
$ mkdir /tmp/x
$ cd /tmp/x
$ git init
Initialized empty Git repository in /tmp/x/.git/
$ echo sc >a
$ git add a
$ echo '#!/bin/sh' >f
$ echo 'sed "s/sc/Santa Claus/"' >>f
$ chmod 755 f
$ git config filter.sc.smudge ./f
$ echo 'a filter=sc' >.gitattributes
$ git add .gitattributes
$ git commit -m.
[master (root-commit) 57f6bef] .
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 .gitattributes
create mode 100644 a
$ rm .gitattributes
$ git archive --prefix=x HEAD | tar xf - xa
$ cat xa
Santa Claus
$ git archive --prefix=y --worktree-attributes HEAD | tar xf - ya
$ cat ya
sc
The first archive call uses the committed .gitattributes file and runs
the file through the smudge filter. The second one uses the worktree
version, which doesn't exist, so no filtering occurs.
What commands do you use?
Thanks,
René
prev parent reply other threads:[~2009-12-15 13:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 1:06 Generic filters for git archive? Russ Dill
2009-12-09 22:48 ` René Scharfe
2009-12-15 7:08 ` Russ Dill
2009-12-15 13:06 ` René Scharfe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B2789EE.1030104@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=russ.dill@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.