From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sverre Rabbelier Subject: [PATCH v4 3/4] fast-import: add option command Date: Mon, 24 Aug 2009 13:52:35 -0700 Message-ID: <1251147156-19279-4-git-send-email-srabbelier@gmail.com> References: <1251147156-19279-1-git-send-email-srabbelier@gmail.com> <1251147156-19279-2-git-send-email-srabbelier@gmail.com> <1251147156-19279-3-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 Mon Aug 24 22:53:38 2009 Return-path: 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 1MfgXp-00068r-PJ for gcvg-git-2@lo.gmane.org; Mon, 24 Aug 2009 22:53:38 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753485AbZHXUxC (ORCPT ); Mon, 24 Aug 2009 16:53:02 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753484AbZHXUxB (ORCPT ); Mon, 24 Aug 2009 16:53:01 -0400 Received: from wa-out-1112.google.com ([209.85.146.176]:31951 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753476AbZHXUw6 (ORCPT ); Mon, 24 Aug 2009 16:52:58 -0400 Received: by wa-out-1112.google.com with SMTP id j5so466600wah.21 for ; Mon, 24 Aug 2009 13:53:00 -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=oBIcESGfLbhTZ5H6pUH1SSotz2g+50dcMBNJHgRvGoM=; b=fwZlQeBzAVWgYFbH8zZPOZaIKzEykceqXmSUx9jukAruC21MY54XArbmw5Nsrj91r8 v30gFKy2BmD9PCfc+gpBuRnMLe7QO4eM+R9Fgf6QRVPF4HV4XFcRrch46S4fNSsBUBUR 8qeNg8PcQ1w5CqdgwrP6py+AFmE5CyyUX5cDU= 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=FZyUIni5NOFkpN+ZnyzB73D6uuhkHBin/KYbx7CIp/Df/Oro43eUFCkSX7wIKd87G1 JmD2RkXH3veQQ0MWJSz3kR9OwthuX6pPhAT6M8KO18yr0R6l2CC+9BCU3V+pgzDxtLXH Xw2giUHcOTCJH4sL+JZF1u37KtYcZ5+DbJk8I= Received: by 10.115.61.9 with SMTP id o9mr6476728wak.217.1251147178816; Mon, 24 Aug 2009 13:52:58 -0700 (PDT) Received: from localhost.localdomain ([216.239.45.19]) by mx.google.com with ESMTPS id 20sm1023981pzk.5.2009.08.24.13.52.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 24 Aug 2009 13:52:57 -0700 (PDT) X-Mailer: git-send-email 1.6.4.16.g72c66.dirty In-Reply-To: <1251147156-19279-3-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 --- Same as v3 but with the --import-marks change already done in 2/4 Documentation/git-fast-import.txt | 23 ++++++++++++++ fast-import.c | 61 +++++++++++++++++++++++++++++------- 2 files changed, 72 insertions(+), 12 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