Re: Git on Windows, CRLF issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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'
...
> +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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux