From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v5a 5/6] fast-import: add option command Date: Thu, 27 Aug 2009 11:40:30 -0700 Message-ID: <1251398431-12461-6-git-send-email-srabbelier@gmail.com> References: <1251398431-12461-1-git-send-email-srabbelier@gmail.com> <1251398431-12461-2-git-send-email-srabbelier@gmail.com> <1251398431-12461-3-git-send-email-srabbelier@gmail.com> <1251398431-12461-4-git-send-email-srabbelier@gmail.com> <1251398431-12461-5-git-send-email-srabbelier@gmail.com> Cc: Sverre Rabbelier To: Junio C Hamano , "Shawn O. Pearce" , Johannes Schindelin , Git List , Ian Clatworthy Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mgjuq-0007FJ-PR for gcvg-git-2@lo.gmane.org; Thu, 27 Aug 2009 20:41:45 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691AbZH0SlV (ORCPT ); Thu, 27 Aug 2009 14:41:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751674AbZH0SlV (ORCPT ); Thu, 27 Aug 2009 14:41:21 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:56292 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbZH0SlU (ORCPT ); Thu, 27 Aug 2009 14:41:20 -0400 Received: by mail-ew0-f206.google.com with SMTP id 2so1486483ewy.17 for ; Thu, 27 Aug 2009 11:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=wLaowvZHmc/E4XJ+gPNZIHbSZiLuAOICRPdpwjZQ8Zk=; b=jt6O2KvvNwKmI2kRUWHq4G+2HRCFPnkoJfRuQnbOo6e64w9fcrmAXzK1OzP33nGEg8 06Lh1C+7qNEhgqxxZYSq1tN60bVhSzO4CQTNuEFhEVSoYaB5XOWOPZUcWw/+kLN7TlEk dMemMwqO/VO+yFPu/eMi561gnezdp1vFDuk3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=u+2mnAiR3XfMUkqe8rEVK3JgS/KvmfpWcvoPpMuL94dP0giiILl089VjcHuXmXnUaS IiwF17rPykJxWt3mjslSkJzQq1xmvLXDuRO0nu8my4UXZW8oc89RewnAPE8zlO9vWU2o /mJuprPP7xe05XDhkZFmFGNdWBmOjUYuTLKjE= Received: by 10.216.10.208 with SMTP id 58mr26040wev.82.1251398481886; Thu, 27 Aug 2009 11:41:21 -0700 (PDT) Received: from localhost.localdomain (kaayla.mtv.corp.google.com [172.22.72.177]) by mx.google.com with ESMTPS id i35sm1687558gve.26.2009.08.27.11.41.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 Aug 2009 11:41:21 -0700 (PDT) X-Mailer: git-send-email 1.6.4.122.g6ffd7 In-Reply-To: <1251398431-12461-5-git-send-email-srabbelier@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: This allows the frontend to specify any of the supported options as long as no non-option command has been given. This way the user does not have to include any frontend-specific options, but instead she can rely on the frontend to tell fast-import what it needs. Also factor out parsing of argv and have it execute when we reach the first non-option command, or after all commands have been read and no non-option command has been encountered. Signed-off-by: Sverre Rabbelier --- Similar to v4, but now requires that the 'feature git-options' command is seen before any 'option' command. Difference from v5 is adding of prefixcmp feature. Documentation/git-fast-import.txt | 23 ++++++++++++ fast-import.c | 68 ++++++++++++++++++++++++++++++------ 2 files changed, 79 insertions(+), 12 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 1e293f2..4ba62f3 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -307,6 +307,11 @@ and control the current import process. More detailed discussion Require that fast-import supports the specified feature, or abort if it does not. +`option`:: + Specify any of the options listed under OPTIONS to change + fast-import's behavior to suit the frontend's needs. This command + is optional and is not needed to perform an import. + `commit` ~~~~~~~~ Create or update a branch with a new commit, recording one logical @@ -829,6 +834,24 @@ it does not. The part of the command may be any string matching [a-zA-Z-] and should be understood by a version of fast-import. +`option` +~~~~~~~~ +Processes the specified option so that git fast-import behaves in a +way that suits the frontend's needs. +Note that options specified by the frontend are overridden by any +options the user may specify to git fast-import itself. + +.... + 'option' SP