From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v6 5/6] fast-import: add option command Date: Wed, 2 Sep 2009 19:57:02 +0200 Message-ID: <1251914223-31435-6-git-send-email-srabbelier@gmail.com> References: <1251914223-31435-1-git-send-email-srabbelier@gmail.com> <1251914223-31435-2-git-send-email-srabbelier@gmail.com> <1251914223-31435-3-git-send-email-srabbelier@gmail.com> <1251914223-31435-4-git-send-email-srabbelier@gmail.com> <1251914223-31435-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 1Miu6G-0007Zr-5p for gcvg-git-2@lo.gmane.org; Wed, 02 Sep 2009 19:58:29 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753246AbZIBR5s (ORCPT ); Wed, 2 Sep 2009 13:57:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753215AbZIBR5s (ORCPT ); Wed, 2 Sep 2009 13:57:48 -0400 Received: from mail-bw0-f219.google.com ([209.85.218.219]:57092 "EHLO mail-bw0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbZIBR5q (ORCPT ); Wed, 2 Sep 2009 13:57:46 -0400 Received: by mail-bw0-f219.google.com with SMTP id 19so909406bwz.37 for ; Wed, 02 Sep 2009 10:57:48 -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=xxvnzVZLnaW0VxItbM/rGdStZJyoNoJYLeSKaoxHcCA=; b=tFOeWqE6A4zFwg4aKWHGlk68rRlTDGzguYcMeeAcvlDFj9CyUHfFNfDc9Tjab5dd8R jYoqEvdb4F54ysAx3lk3dhXGnIFoyfaPp72ooxzzcfpmkOYvQWTj/n+QEBTeQnWXeXvi Pr7LD4eC57mHBTQgF4VFbYAMfmSxLaw4k4M54= 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=XDxHGbfNen9AQriUabESD5HNIRbuOPvP94e3taRmg7walrQaN5XIArPIALe6GxtRQL 90pCxox1MFAkDSvNZ+aFigE0omU2g0/vtC/yxKb8l1n+rU6Xr60QRRe15ut+bYG+ZFb9 mHzY+KWwfXr/7bV6IN0hfkFjBhPLUwwUA4gv0= Received: by 10.204.34.8 with SMTP id j8mr7045761bkd.54.1251914268317; Wed, 02 Sep 2009 10:57:48 -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 21sm325505fks.9.2009.09.02.10.57.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Sep 2009 10:57:47 -0700 (PDT) X-Mailer: git-send-email 1.6.4.16.g72c66.dirty In-Reply-To: <1251914223-31435-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 --- Main difference with v5 is that the syntax is now 'option git ...' as per a discussion with the other fast-import devs. Other options, e.g. 'option hg' are ignored. Also fixed the docs to say that feature commands are allowed before git option commands. Documentation/git-fast-import.txt | 24 ++++++++++++ fast-import.c | 75 +++++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 12 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