Re: [PATCH] Added "-kb" to all the entries lines sent to the client
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 22, 2007, 20:37 UTC
- Message-ID
- <7v4ppedj3r.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <200702221606.42638.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
> Perhaps when the whole .gitattributes system has settled down that could be > used to conditionally set -kb
Indeed. And this patch is a great help by identifying where to insert necessary '-kb'.
If the patch had a stub implementation to determine if -kb is needed (and the stub always says "yes" for your purpose, or "no" for backward compatibility for non-text files), it could be applied to the mainline for wider testing.
sub path_is_binary {
my ($filename) = @_; # If you do not mind LF lineendings and care more about
# binary files, return true from here; otherwise you may
# want to change this to return false.
# We'll ask the much talked about .gitattributes
# mechanism when it's ready.
return 1;
}sub req_add {
...
$kb = path_is_binary($filename) ? "-kb" : "";
print "Checked-in $dirpart\n";
print "$filename\n";
print "/$filepart/0//$kb/\n";$addcount++; }