From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Achleitner Subject: [RFC 11/16] Add explanatory comment for transport-helpers refs mapping. Date: Thu, 26 Jul 2012 09:32:32 +0200 Message-ID: <1343287957-22040-12-git-send-email-florian.achleitner.2.6.31@gmail.com> References: <1343287957-22040-1-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-2-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-3-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-4-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-5-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-6-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-7-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-8-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-9-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-10-git-send-email-florian.achleitner.2.6.31@gmail.com> <1343287957-22040-11-git-send-email-florian.achleitner.2.6.31@gmail.com> Cc: florian.achleitner.2.6.31@gmail.com To: Jonathan Nieder , David Michael Barr , git@vger.kernel.org X-From: git-owner@vger.kernel.org Thu Jul 26 09:35:08 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SuIbD-0005DO-K3 for gcvg-git-2@plane.gmane.org; Thu, 26 Jul 2012 09:35:07 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863Ab2GZHer (ORCPT ); Thu, 26 Jul 2012 03:34:47 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:58737 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798Ab2GZHeo (ORCPT ); Thu, 26 Jul 2012 03:34:44 -0400 Received: by mail-bk0-f46.google.com with SMTP id j10so1067267bkw.19 for ; Thu, 26 Jul 2012 00:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=dTjFxBG+qZmRLW3xMzhyEsIrdBCHJNWhAS6hfyW9vqw=; b=DrrNsxjQ5p7aBIR6ExI8jYKoITu4WF2QN4i+T0dXkUy4yyE4+NY7YqNwkdsY0Kz/Jt z0YrSyhB1LS2+cFDhefWLAAf/RiH9mT7PVK02lzaYAKcHcIxA8QV06uio2Z7lrvNOiNs KYiVY3hyMzfWTb5ApD/7AeX0zNluZFRwpdR3efDChW2GuwbM87h1Qe/Y8X9IsP8BAcW6 jWwSbfoc/4BBI/zZX/Artv2g4q0+s0D1WPzRZxD9cs7NtGKCEEJLlPbpNbUJ+Z9pZMEe 0RI+n/HbNNgRfehKzTjtVM+LjJl85WD0t3ajhIXu5lkzSCyXsKB16Fr3FgbVA/Knsp/b gC5g== Received: by 10.205.117.141 with SMTP id fm13mr13571410bkc.125.1343288084159; Thu, 26 Jul 2012 00:34:44 -0700 (PDT) Received: from localhost.localdomain (cm56-227-93.liwest.at. [86.56.227.93]) by mx.google.com with ESMTPS id n5sm13880348bkv.14.2012.07.26.00.34.41 (version=SSLv3 cipher=OTHER); Thu, 26 Jul 2012 00:34:42 -0700 (PDT) X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343287957-22040-11-git-send-email-florian.achleitner.2.6.31@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: transport-helpers can advertise the 'refspec' capability, if not a default refspec *:* is assumed. This explains the post-processing of refs after fetching with fast-import. Signed-off-by: Florian Achleitner --- transport-helper.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/transport-helper.c b/transport-helper.c index d6daad5..e10fd6b 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -478,6 +478,21 @@ static int fetch_with_import(struct transport *transport, argv_array_clear(&importer_argv); + /* + * If the remote helper advertised the "refspec" capability, + * it will have the written result of the import to the refs + * named on the right hand side of the first refspec matching + * each ref we were fetching. + * + * (If no "refspec" capability was specified, for historical + * reasons we default to *:*.) + * + * Store the result in to_fetch[i].old_sha1. Callers such + * as "git fetch" can use the value to write feedback to the + * terminal, populate FETCH_HEAD, and determine what new value + * should be written to peer_ref if the update is a + * fast-forward or this is a forced update. + */ for (i = 0; i < nr_heads; i++) { char *private; posn = to_fetch[i]; -- 1.7.9.5