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

[PATCH] git-cvsserver: added support for update -p

From
JWJan Wielemaker <jan@swi-prolog.org>
Date
Oct 10, 2007, 11:16 UTC
Message-ID
<200710101316.03633.jan@swi-prolog.org>

[PATCH] git-cvsserver: added support for update -p --- Hi,

Someone in our team uses "cvs update -p [-r rev] file" (somehow invoked through TortoiseCVS). The patch below provides that. I think it is fine, except that I don't know with wich other flags -p can be combined and therefore when exactly this should be tested. Figured out that normal CVS sends the file line-by-line preceeded by "M " using strace on the client to a real CVS server.

	Enjoy --- Jan
 git-cvsserver.perl |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 13dbd27..987f4d6 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -956,6 +956,21 @@ sub req_update
             $meta = $updater->getmeta($filename);
         }
 
+	# if we have a -p we should just send the file
+        if ( exists ( $state->{opt}{p} ) )
+	{
+	    if ( open my $fh, '-|', "git-cat-file", "blob", $meta->{filehash} )
+	    {   while ( <$fh> )
+		{ print "M " . $_;
+		}
+		close $fh or die ("Couldn't close filehandle for transmitfile(): $!");
+	    } else
+	    { die("Couldn't execute git-cat-file");
+	    }
+
+	    next;
+	}
+
 	if ( ! defined $meta )
 	{
 	    $meta = {
-- 
1.5.3.4
Next: Johannes Schindelin
Message 1 of 13 in “git-cvsserver: added support for update -p”
  1. git-cvsserver: added support for update -pJan Wielemaker, Oct 10, 2007
  2. Johannes SchindelinOct 10, 2007
  3. Jan WielemakerOct 10, 2007
  4. Johannes SchindelinOct 10, 2007
  5. Jan WielemakerOct 10, 2007
  6. Johannes SchindelinOct 10, 2007
  7. Frank LichtenheldOct 10, 2007
  8. Andreas EricssonOct 11, 2007
  9. cvsserver: added support for update -pFrank Lichtenheld, Oct 11, 2007
  10. Jan WielemakerOct 11, 2007
  11. Frank LichtenheldOct 11, 2007
  12. Johannes SchindelinOct 11, 2007
  13. Frank LichtenheldOct 11, 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.