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

[PATCH] Added "-kb" to all the entries lines sent to the client

From
APAndy Parkins <andyparkins@gmail.com>
Date
Feb 22, 2007, 16:06 UTC
Message-ID
<200702221606.42638.andyparkins@gmail.com>
In-Reply-To
<200702221504.32848.andyparkins@gmail.com>

git doesn't distinguish between binary and text files - so force the client to do the same by sending everything as a binary.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
DON'T APPLY TO REPOSITORY
Turns out the CVS protocol isn't as hard as I thought.
http://soc.if.usp.br/doc/cvs/html-cvsclient/cvsclient_5.html#SEC6

Was all I needed. I've changed every entries line to send "-kb" as one of options. I believe this will make all files into binaries as far as CVS clients are concerned.

I am certain this is too heavy handed for most users. I submit this patch only to help other poor souls who might have the same problem in the future. (Hello poor soul).

Perhaps when the whole .gitattributes system has settled down that could be used to conditionally set -kb

 git-cvsserver.perl |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index f6ddf34..e8d74ae 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -374,7 +374,7 @@ sub req_add
 
         print "Checked-in $dirpart\n";
         print "$filename\n";
-        print "/$filepart/0///\n";
+        print "/$filepart/0//-kb/\n";
 
         $addcount++;
     }
@@ -455,7 +455,7 @@ sub req_remove
 
         print "Checked-in $dirpart\n";
         print "$filename\n";
-        print "/$filepart/-1.$wrev///\n";
+        print "/$filepart/-1.$wrev//-kb/\n";
 
         $rmcount++;
     }
@@ -726,7 +726,7 @@ sub req_co
        print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) and 
$git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "$git->{name}\n";
 
         # this is an "entries" line
-        print "/$git->{name}/1.$git->{revision}///\n";
+        print "/$git->{name}/1.$git->{revision}//-kb/\n";
         # permissions
         print "u=$git->{mode},g=$git->{mode},o=$git->{mode}\n";
 
@@ -917,8 +917,8 @@ sub req_update
 		print $state->{CVSROOT} . "/$state->{module}/$filename\n";
 
 		# this is an "entries" line
-		$log->debug("/$filepart/1.$meta->{revision}///");
-		print "/$filepart/1.$meta->{revision}///\n";
+		$log->debug("/$filepart/1.$meta->{revision}//-kb/");
+		print "/$filepart/1.$meta->{revision}//-kb/\n";
 
 		# permissions
 		$log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}");
@@ -961,8 +961,8 @@ sub req_update
                     print "Update-existing $dirpart\n";
                     
$log->debug($state->{CVSROOT} . "/$state->{module}/$filename");
                     print 
$state->{CVSROOT} . "/$state->{module}/$filename\n";
-                    $log->debug("/$filepart/1.$meta->{revision}///");
-                    print "/$filepart/1.$meta->{revision}///\n";
+                    $log->debug("/$filepart/1.$meta->{revision}//-kb/");
+                    print "/$filepart/1.$meta->{revision}//-kb/\n";
                 }
             }
             elsif ( $return == 1 )
@@ -975,7 +975,7 @@ sub req_update
                 {
                     print "Update-existing $dirpart\n";
                     print 
$state->{CVSROOT} . "/$state->{module}/$filename\n";
-                    print "/$filepart/1.$meta->{revision}/+//\n";
+                    print "/$filepart/1.$meta->{revision}/+/-kb/\n";
                 }
             }
             else
@@ -1207,7 +1207,7 @@ sub req_ci
         } else {
             print "Checked-in $dirpart\n";
             print "$filename\n";
-            print "/$filepart/1.$meta->{revision}///\n";
+            print "/$filepart/1.$meta->{revision}//-kb/\n";
         }
     }
 
-- 
1.5.0.1.51.g5a369
Previous: Andy ParkinsNext: Junio C Hamano
Message 2 of 17 in “git-cvsserver and binary files”
  1. Andy ParkinsFeb 22, 2007
  2. Added "-kb" to all the entries lines sent to the clientAndy Parkins, Feb 22, 2007
  3. Junio C HamanoFeb 22, 2007
  4. cvsserver: Make always-binary mode a config file optionAndy Parkins, Feb 27, 2007
  5. Martin LanghoffFeb 28, 2007
  6. Andy ParkinsFeb 28, 2007
  7. Martin LanghoffFeb 28, 2007
  8. Andy ParkinsMar 1, 2007
  9. Martin LanghoffMar 1, 2007
  10. Andy ParkinsMar 1, 2007
  11. Junio C HamanoMar 1, 2007
  12. Junio C HamanoMar 1, 2007
  13. Junio C HamanoMar 1, 2007
  14. Andy ParkinsMar 1, 2007
  15. Karl HasselströmMar 1, 2007
  16. cvsserver: Make always-binary mode a config file optionAndy Parkins, Feb 27, 2007
  17. Junio C HamanoFeb 27, 2007

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.