From: Sergio Callegari <sergio.callegari@gmail.com>
To: git@vger.kernel.org
Subject: Re: Question about --tree-filter
Date: Wed, 04 Feb 2009 21:42:46 +0100 [thread overview]
Message-ID: <4989FDC6.2080404@gmail.com> (raw)
In-Reply-To: <4989C437.4070401@viscovery.net>
Johannes Sixt wrote:
> Sergio Callegari schrieb:
>
>> in working with the "rezip" filter for the efficient git management of
>> openoffice, zip and docx files, I am encountering the following problem.
>>
>> Suppose that you have an existing repository and that you want to convert it
>> into a repository using the rezip filters: git filter-branch should be the tool
>> to do the conversion.
>>
>> Initially I believed that once set up the appropriate .git/config filter entries
>> and a .git/info/attributes file tying the filter to the appropriate file types,
>> it would have been enough to
>>
>> git filter-branch --tree-filter true tag-name-filter cat
>>
>> to do the conversion.
>> This is also what I suggested in my original post about the rezip script.
>>
>> Unfortunately, this does not seem to work as expected. Not all files get
>> rewritten as filtered blobs.
>>
>
> Before the tree-filter runs, the files are checked out (and smudged by
> rezip). But they are marked as unchanged (because they were checked out
> moments ago). Since your tree-filter doesn't do anything, no new blobs are
> added to the index, and none of your files are cleaned by rezip.
>
> I think your brute-force tree-filter should be
>
> rm -f "$GIT_INDEX_FILE"
>
> assuming that a .gitattributes file is already in all revisions.
>
> -- Hannes
>
Sorry, it still is not completely clear to me... I would be very glad if
you could detail better what happens when I tree-filter. From what you
say I get the impression that no file should get a new blob. As a
matter of fact, most do (and that is why at the very beginning I thought
that --tree-filter true would have been sufficient)... only a few do not
get the new blob.
And if I experiment filter-branch again, with exactly the same
parameters, apparently some of the files that did not get the new blob
in the beginning do... which looks completely weird.
The attributes are in the info subdir of .git, so the brute force
approach should be fine. I guess that it does not make any difference
wrt to a
find ./ -type f -exec touch \{\} \;
apart from looking slightly more aggressive to the index (and faster) or
does it?
Sergio
next prev parent reply other threads:[~2009-02-04 20:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-04 16:08 Question about --tree-filter Sergio Callegari
2009-02-04 16:37 ` Johannes Sixt
2009-02-04 20:42 ` Sergio Callegari [this message]
2009-02-05 8:32 ` Johannes Sixt
2009-02-05 13:13 ` Sergio Callegari
2009-02-05 13:57 ` Johannes Sixt
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=4989FDC6.2080404@gmail.com \
--to=sergio.callegari@gmail.com \
--cc=git@vger.kernel.org \
/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).