git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars Noschinski <lars@public.noschinski.de>
To: git@vger.kernel.org
Cc: fabian.emmes@rwth-aachen.de, Lars Noschinski <lars@public.noschinski.de>
Subject: [PATCH] cvsserver: Add support for packed refs
Date: Thu, 17 Jul 2008 12:01:14 +0200	[thread overview]
Message-ID: <1216288877-12140-3-git-send-email-lars@public.noschinski.de> (raw)
In-Reply-To: <1216288877-12140-2-git-send-email-lars@public.noschinski.de>

req_update still parses /refs/heads manually. Replace this by
a call to show-ref.

Signed-off-by: Lars Noschinski <lars@public.noschinski.de>
---
 git-cvsserver.perl |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index b00d1c2..0e4f5f9 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -947,24 +947,17 @@ sub req_update
     # projects (heads in this case) to checkout.
     #
     if ($state->{module} eq '') {
-	my $heads_dir = $state->{CVSROOT} . '/refs/heads';
-	if (!opendir HEADS, $heads_dir) {
-	    print "E [server aborted]: Failed to open directory, "
-	      . "$heads_dir: $!\nerror\n";
-	    return 0;
-	}
-        print "E cvs update: Updating .\n";
-	while (my $head = readdir(HEADS)) {
-	    if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {
-	        print "E cvs update: New directory `$head'\n";
-	    }
-	}
-	closedir HEADS;
-	print "ok\n";
-	return 1;
+        my $showref = `git show-ref --heads`;
+        for my $line (split '\n', $showref) {
+            if ( $line =~ m% refs/heads/(.*)$% ) {
+                print "M $1\t$1\n";
+            }
+        }
+        closedir HEADS;
+        print "ok\n";
+        return 1;
     }
 
-
     # Grab a handle to the SQLite db and do any necessary updates
     my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);
 
-- 
1.5.6.2

  reply	other threads:[~2008-07-17 10:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 10:01 Some cvs related fixes and enhancements Lars Noschinski
2008-07-17 10:01 ` [PATCH] Testsuite: Unset CVS_SERVER Lars Noschinski
2008-07-17 10:01   ` Lars Noschinski [this message]
2008-07-17 10:01     ` [PATCH] cvsserver: Add testsuite for packed refs Lars Noschinski
2008-07-17 10:01       ` [PATCH] cvsserver: Add cvs co -c support Lars Noschinski
2008-07-17 10:01         ` [PATCH] testsuite for cvs co -c Lars Noschinski
2008-07-17 11:54       ` [PATCH] cvsserver: Add testsuite for packed refs Johannes Schindelin
2008-07-17 11:50     ` [PATCH] cvsserver: Add support " Johannes Schindelin
2008-07-17 12:40       ` Lars Noschinski
2008-07-17 11:45   ` [PATCH] Testsuite: Unset CVS_SERVER Johannes Schindelin
2008-07-17 17:53   ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2008-07-17 17:00 Some cvs related fixes and enhancements v2 Lars Noschinski
2008-07-17 17:00 ` [PATCH] Testsuite: Unset CVS_SERVER Lars Noschinski
2008-07-17 17:00   ` [PATCH] cvsserver: Add support for packed refs Lars Noschinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1216288877-12140-3-git-send-email-lars@public.noschinski.de \
    --to=lars@public.noschinski.de \
    --cc=fabian.emmes@rwth-aachen.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).