Re: Git on Windows, CRLF issues
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Apr 23, 2008, 10:58 UTC
- Message-ID
- <480F1671.2060602@viscovery.net>
- In-Reply-To
- <20080423080826.GA11935@sigill.intra.peff.net>
Jeff King schrieb:
> It was easy enough to work up the patch below, which allows > > git filter-branch --blob-filter 'tr a-z A-Z'
...
Show 16 quoted lines
> +munge_blobs() {
> + while read mode sha1 stage path
> + do
> + if ! test -r "$workdir/../blob-cache/$sha1"
> + then
> + new=`git cat-file blob $sha1 |
> + eval "$filter_blob" |
> + git hash-object -w --stdin`
> + printf $new >$workdir/../blob-cache/$sha1
> + fi
> + printf "%s %s\t%s\n" \
> + "$mode" \
> + $(cat "$workdir/../blob-cache/$sha1") \
> + "$path"
> + done
> +}In practice, this is not sufficient. The blob filter must have an opportunity to decide what it wants to do, not just blindly munge every blob. The minimum is a path name, e.g. in $1:
new=$(git cat-file blob $sha1 | $SHELL_PATH -c "$filter_blob" ignored "$path" | git hash-object -w --stdin)
-- Hannes