From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Johannes Sixt" <j.sixt@viscovery.net>,
"Peter Karlsson" <peter@softwolves.pp.se>,
git@vger.kernel.org
Subject: Re: Git on Windows, CRLF issues
Date: Thu, 24 Apr 2008 12:56:40 -0400 [thread overview]
Message-ID: <32541b130804240956u2ec5817ey7b9652447489bc86@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0804240909220.26553@eeepc-johanness>
On 4/24/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Wed, 23 Apr 2008, Avery Pennarun wrote:
> > What I really want is the equivalent of "dos2unix --recursive *.c *.txt
> > etc" for all commits.
>
> I start to wonder if "git fast-export --all | my-intelligent-perl-script |
> git fast-import" would not be a better solution here.
>
> All you would have to do is to detect when a blob begins, and how long it
> is, and work with that. If your trees do not contain any binary files, it
> should be trivial.
Err, yes... as long as there are no binary files. I'm not so lucky,
and life is a little more complex in that case. It also gives no easy
way of selectively applying the blob filter based on filename, which
is pretty important when you do have some binary files and you're
trying to decide whether to run dos2unix.
(In contrast, the *other* objection, which is that the same blob might
have multiple filenames, doesn't bother me at all, since I'm sure I
don't have any .txt files that were accidentally named .jpg at some
point.)
I agree that a working solution based on
git-fast-export/git-fast-import should run faster than any of the
other proposed solutions, but my version of Jeff's patch is quite fast
and it's easy to compose simple command lines that "make simple things
simple and hard things possible":
git-filter-branch --blob-filter dos2unix HEAD
git-filter-branch --blob-filter 'case "$path" in *.c) expand -8;; *)
cat;; esac' HEAD
It sure beats writing a perl script every time you want to do something.
Jeff wrote:
> But I think the problem then is
> that the blob filter isn't terribly useful. IOW, it is not really a
> separate filter, but rather an optimizing pattern for an index filter,
> so maybe calling it a blob filter is the wrong approach
The problem is that doing an optimization on an index filter is kind
of hard for a user to express, and each user will have to implement
the caching logic by hand every time. Using --index-filter at all
requires extremely high levels of shell and git knowledge.
The fact that the blob transformation might "slightly depend on" the
path is not actually very important; fundamentally we're still
transforming blobs, not paths. We're just using the filename as a
*hint* about what kind of transformation we need to do on that
particular blob.
I think the measure of a good idea here is how straightforward it is
to express what you want on the command line, and --blob-filter makes
it easy to express a certain class of filters.
Have fun,
Avery
next prev parent reply other threads:[~2008-04-24 16:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-21 19:48 Git on Windows, CRLF issues Peter Karlsson
2008-04-21 20:07 ` Johannes Schindelin
2008-04-21 21:53 ` Avery Pennarun
2008-04-22 2:39 ` Jeff King
2008-04-22 16:51 ` Avery Pennarun
2008-04-23 7:11 ` Peter Karlsson
2008-04-23 8:10 ` Jeff King
2008-04-23 13:47 ` Peter Karlsson
2008-04-23 14:24 ` Johan Herland
2008-04-23 15:12 ` Johannes Sixt
2008-04-23 8:08 ` Jeff King
2008-04-23 10:13 ` Johannes Schindelin
2008-04-23 10:58 ` Jeff King
2008-04-23 10:58 ` Johannes Sixt
2008-04-23 11:04 ` Jeff King
2008-04-23 11:46 ` Johannes Sixt
2008-04-23 21:47 ` Jeff King
2008-04-23 23:01 ` Junio C Hamano
2008-04-23 23:04 ` Avery Pennarun
2008-04-24 8:11 ` Johannes Schindelin
2008-04-24 16:56 ` Avery Pennarun [this message]
2008-04-24 1:37 ` Jeff King
2008-04-23 20:02 ` Avery Pennarun
2008-04-24 6:25 ` Johannes Sixt
2008-04-22 6:41 ` Johannes Sixt
2008-04-21 21:51 ` Jakub Narebski
2008-04-22 6:52 ` Peter Karlsson
2008-04-22 9:04 ` Johannes Sixt
2008-04-22 6:31 ` Johannes Sixt
2008-04-22 8:42 ` Peter Karlsson
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=32541b130804240956u2ec5817ey7b9652447489bc86@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=peff@peff.net \
--cc=peter@softwolves.pp.se \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).