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

Re: [PATCH 1/3 v2] Add --blob-filter option to filter-branch.

From
Avery Pennarun <apenwarr@gmail.com>
Date
Apr 23, 2008, 22:07 UTC
Message-ID
<32541b130804231507l4aff2ca3x962bf385a409685b@mail.gmail.com>
In-Reply-To
<20080423215501.GB30057@sigill.intra.peff.net>
On 4/23/08, Jeff King <peff@peff.net> wrote:
Show 15 quoted lines
> On Wed, Apr 23, 2008 at 04:18:10PM -0400, Avery Pennarun wrote:
>
>  > From: Jeff King <peff@peff.net>
>  >
>  > This patch allows
>  >
>  >   git filter-branch --blob-filter 'tr a-z A-Z'
>
> The commit message munging you did is fine.
>
>  However, I think Johannes Sixt's question about providing the pathname
>  needs to be resolved. As it is now, the blob-filter is impossible to use
>  in a mixed binary/text repository, short of the undocumented $path magic
>  that you described. And I am a little uncomfortable just adding the
>  $path as he suggested because of the subtle bug it introduces.

It is indeed a very subtle bug; so subtle, in fact, that I never expect to experience it myself :)

I think it would be fine to index into the cache using $path$sha1, which would seem to resolve this issue. The catch is that $path isn't a very good cachefile name. I'd suggest doing an md5sum or something on it, but that would result in an extra fork for every file, which brings us back to our original level of slowness (or worse).

Hmm, I gues using a cachefile like $sha1/$path would work; it requires a "mkdir -p", but only when *filling* the cache.

Avery
Previous: Jeff KingNext: Jeff King
Message 10 of 11 in “Add --blob-filter option to filter-branch.”
  1. 1/3 Add --blob-filter option to filter-branch.Avery Pennarun, Apr 23, 2008
  2. 2/3 Make filter-branch --glob-filter much faster by not calling 'cat'Avery Pennarun, Apr 23, 2008
  3. 3/3 Update documentation to describe git filter-branch --blob-filter.Avery Pennarun, Apr 23, 2008
  4. Johannes SchindelinApr 23, 2008
  5. Avery PennarunApr 23, 2008
  6. Johannes SchindelinApr 23, 2008
  7. 1/3 Add --blob-filter option to filter-branch.Avery Pennarun, Apr 23, 2008
  8. Johannes SchindelinApr 23, 2008
  9. Jeff KingApr 23, 2008
  10. Avery PennarunApr 23, 2008
  11. Jeff KingApr 24, 2008

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.