From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v8 4/7] fast-import: add option command Date: Fri, 4 Dec 2009 18:06:57 +0100 Message-ID: <1259946420-8845-5-git-send-email-srabbelier@gmail.com> References: <1259946420-8845-1-git-send-email-srabbelier@gmail.com> <1259946420-8845-2-git-send-email-srabbelier@gmail.com> <1259946420-8845-3-git-send-email-srabbelier@gmail.com> <1259946420-8845-4-git-send-email-srabbelier@gmail.com> Cc: Sverre Rabbelier To: Junio C Hamano , "Shawn O. Pearce" , Johannes Schindelin , Git List , 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 1NGbdE-000621-PW for gcvg-git-2@lo.gmane.org; Fri, 04 Dec 2009 18:07:49 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932277AbZLDRHV (ORCPT ); Fri, 4 Dec 2009 12:07:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932274AbZLDRHV (ORCPT ); Fri, 4 Dec 2009 12:07:21 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:58084 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932264AbZLDRHP (ORCPT ); Fri, 4 Dec 2009 12:07:15 -0500 Received: by mail-ew0-f219.google.com with SMTP id 19so3051396ewy.1 for ; Fri, 04 Dec 2009 09:07:21 -0800 (PST) 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=EUnNoisjKudY/3aLtoyjqN75Osig97YzDvbZ2fY/TjM=; b=K64ZcT8v26DC1ayljfpXgnoZnpV6yGpFTIdIRscpsL2wt86HPq540sfpluawQt9+0t TXIlOUJmrBKUv+qaeuubwn2e6CihCnpyQbFhAXxsmehKHjGX9/Qoz/lcmctJ/J3RmpYB HVT5MaFOgZDbBgwxO+0O48d+MiLsVRw11ZUHI= 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=vxMfpwnrnkK/D471dOhozjTIUgdxYsv78i6IasHfmgi1yBQiOFaa8oas0biwUJkUNk u0o/HlflAxF+8xXHqO96Vti2dAyn8Ety9UphsbMxZWQK6Y0ASmVYKHEd8zi6vAZPY3zE h4xFdTtfHKe/jlY+vWJWR0jye1QqLJexLfonY= Received: by 10.213.96.207 with SMTP id i15mr5487305ebn.69.1259946441651; Fri, 04 Dec 2009 09:07:21 -0800 (PST) Received: from localhost.localdomain (ip138-114-211-87.adsl2.static.versatel.nl [87.211.114.138]) by mx.google.com with ESMTPS id 16sm1980184ewy.14.2009.12.04.09.07.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Dec 2009 09:07:20 -0800 (PST) X-Mailer: git-send-email 1.6.5.3.164.g07b0c In-Reply-To: <1259946420-8845-4-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. Non-git options are ignored, unrecognised options result in an error. Signed-off-by: Sverre Rabbelier --- Reject unknown options, update documentation, and some style fixes. Documentation/git-fast-import.txt | 32 +++++++++++++ fast-import.c | 87 ++++++++++++++++++++++++++----------- 2 files changed, 94 insertions(+), 25 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 4357c21..2d5f533 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 that do not + change stream semantic 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 @@ -871,6 +876,33 @@ The following features are currently supported: * export-marks * force +`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