From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v3 2/3] fast-import: add option command Date: Thu, 13 Aug 2009 12:02:35 -0700 Message-ID: <1250190156-4752-3-git-send-email-srabbelier@gmail.com> References: <1250190156-4752-1-git-send-email-srabbelier@gmail.com> <1250190156-4752-2-git-send-email-srabbelier@gmail.com> Cc: Sverre Rabbelier To: "Junio C Hamano" , "Shawn O. Pearce" , "Johannes Schindelin" , "Git List" X-From: git-owner@vger.kernel.org Thu Aug 13 21:03:10 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbfZs-0007Q3-Dr for gcvg-git-2@gmane.org; Thu, 13 Aug 2009 21:03:08 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755377AbZHMTC6 (ORCPT ); Thu, 13 Aug 2009 15:02:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755373AbZHMTC5 (ORCPT ); Thu, 13 Aug 2009 15:02:57 -0400 Received: from rv-out-0506.google.com ([209.85.198.225]:36825 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755370AbZHMTCz (ORCPT ); Thu, 13 Aug 2009 15:02:55 -0400 Received: by rv-out-0506.google.com with SMTP id f6so305427rvb.1 for ; Thu, 13 Aug 2009 12:02:56 -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=fw4kFNNbO2huQ6mXkHMf0VWeNZ0o1cgakvBcBJ5rlVY=; b=HV943RkjXeUE04myuz/Svtm2v7czVJjEoJ6L8+VAtPZT1Il5arBVmiwMYeGm0wcbry HCN/17Lli2XJ1hI8930KJPSu8bNABaQnHG3AWT3eznRe373N/w8MgDenk8kE8Nv55lm2 WiQ6hUZkVG6yF1etaju2ybqOC8P2pIt0RW0xM= 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=DSZo7u1wLYrKvPTeplUk2OXdHLlOmX/k4eVzfWFG4Uee8gmGm89vroy1j3ArcETIv7 DJmkpU/tuTEg57OFnoOyUI1qUhgkxQ16wft5Sb+njkSSsH48s0MEGzbWLEvOWrmtFhWG F+ouqcP0bMUTpEhR7x6M3WzLvgsjvlffyHgpI= Received: by 10.140.144.6 with SMTP id r6mr634125rvd.137.1250190176694; Thu, 13 Aug 2009 12:02:56 -0700 (PDT) Received: from localhost.localdomain ([216.239.45.19]) by mx.google.com with ESMTPS id f42sm3575374rvb.35.2009.08.13.12.02.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 Aug 2009 12:02:55 -0700 (PDT) X-Mailer: git-send-email 1.6.4.16.g72c66.dirty In-Reply-To: <1250190156-4752-2-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. Lastly do not read the marks file till after all options have been parsed, instead of when receiving the option. Signed-off-by: Sverre Rabbelier --- Now we delay reading the marks file till option parsing is done. Documentation/git-fast-import.txt | 23 +++++++ fast-import.c | 130 +++++++++++++++++++++++++------------ 2 files changed, 111 insertions(+), 42 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index c2f483a..ed8bd0d 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -303,6 +303,11 @@ and control the current import process. More detailed discussion standard output. This command is optional and is not needed to perform an import. +`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 @@ -813,6 +818,24 @@ Placing a `progress` command immediately after a `checkpoint` will inform the reader when the `checkpoint` has been completed and it can safely access the refs that fast-import updated. +`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