From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v7 5/6] fast-import: add option command Date: Sun, 6 Sep 2009 16:35:47 +0200 Message-ID: <1252247748-14507-6-git-send-email-srabbelier@gmail.com> References: <1252247748-14507-1-git-send-email-srabbelier@gmail.com> <1252247748-14507-2-git-send-email-srabbelier@gmail.com> <1252247748-14507-3-git-send-email-srabbelier@gmail.com> <1252247748-14507-4-git-send-email-srabbelier@gmail.com> <1252247748-14507-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 1MkIrD-00078l-3P for gcvg-git-2@lo.gmane.org; Sun, 06 Sep 2009 16:36:43 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757987AbZIFOgZ (ORCPT ); Sun, 6 Sep 2009 10:36:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757981AbZIFOgV (ORCPT ); Sun, 6 Sep 2009 10:36:21 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:36677 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbZIFOgS (ORCPT ); Sun, 6 Sep 2009 10:36:18 -0400 Received: by mail-ew0-f206.google.com with SMTP id 2so1511768ewy.17 for ; Sun, 06 Sep 2009 07:36:20 -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=Qyeg/425+nHxCSAz5fNp5LGgZ0kzExkS1kO8mrwqREs=; b=mpCpSuY20ogOoooRJeEnrX41AKum9f/GUtnrCrbzESi6JLQIbSM5iDXxU2OODtrlEO /IuleGILrr0I5w1oRFez5j+8QqC2wIVNyOsJDWH/ET9vBUjqgnsG1nIS6fJIDn0Az+1h 1xFSsFBf0QoJNNwU2i2DcS4h8hAhDIEPPQ/qo= 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=NiYeHQ2Ah8nMQdUM8xda7Gjm7KP0TsK6r1qqGiAoYIKH2H8LbfkEKZZcFsL3rSpjJu 0LSm8gpGWcw+lkmpqBbh5zDq/hpKlJdRCBFLqi0THi3V32hn4pBfBp3f10ecQ+RHfrSZ wpzyShyh6VnLoa9Ls+ZH37GeVlgg5a25sztKQ= Received: by 10.216.90.129 with SMTP id e1mr1299324wef.98.1252247780294; Sun, 06 Sep 2009 07:36:20 -0700 (PDT) Received: from localhost.localdomain (ip138-114-211-87.adsl2.static.versatel.nl [87.211.114.138]) by mx.google.com with ESMTPS id q9sm8759493gve.6.2009.09.06.07.36.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 06 Sep 2009 07:36:19 -0700 (PDT) X-Mailer: git-send-email 1.6.4.16.g72c66.dirty In-Reply-To: <1252247748-14507-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. Non-git options and unrecognised git options are ignored, although unrecognised options on the commandline still result in an error. Signed-off-by: Sverre Rabbelier --- Fixed a few style errors pointed out by Junio and ignore unrecognised git options. Documentation/git-fast-import.txt | 24 +++++++++++ fast-import.c | 81 ++++++++++++++++++++++++++++++------ 2 files changed, 91 insertions(+), 14 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 1e293f2..f1c94b4 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,25 @@ 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