From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: Re: [PATCH 1/4] Add a simple option parser for use by builtin-commit.c. Date: Mon, 1 Oct 2007 12:39:43 +0100 (BST) Message-ID: References: <1190868632-29287-1-git-send-email-krh@redhat.com> <20070930131133.GA11209@diku.dk> <20071001103148.GC8315@diku.dk> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Kristian =?iso-8859-1?Q?H=F8gsberg?= , gitster@pobox.com, git@vger.kernel.org To: Jonas Fonseca X-From: git-owner@vger.kernel.org Mon Oct 01 13:41:08 2007 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 1IcJe8-00013b-14 for gcvg-git-2@gmane.org; Mon, 01 Oct 2007 13:41:08 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751501AbXJALk6 (ORCPT ); Mon, 1 Oct 2007 07:40:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751408AbXJALk6 (ORCPT ); Mon, 1 Oct 2007 07:40:58 -0400 Received: from mail.gmx.net ([213.165.64.20]:34883 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751291AbXJALk4 (ORCPT ); Mon, 1 Oct 2007 07:40:56 -0400 Received: (qmail invoked by alias); 01 Oct 2007 11:40:55 -0000 Received: from unknown (EHLO [138.251.11.74]) [138.251.11.74] by mail.gmx.net (mp018) with SMTP; 01 Oct 2007 13:40:55 +0200 X-Authenticated: #1490710 X-Provags-ID: V01U2FsdGVkX1/t0c94kmTtyZuwPehzD3RXPVgfkTapRNF8zHmzvR FxjKe/OiZbjtlO X-X-Sender: gene099@racer.site In-Reply-To: <20071001103148.GC8315@diku.dk> X-Y-GMX-Trusted: 0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Hi, On Mon, 1 Oct 2007, Jonas Fonseca wrote: > Johannes Schindelin wrote Mon, Oct 01, 2007: > > > On Sun, 30 Sep 2007, Jonas Fonseca wrote: > > > > > Also, I think for this to be more usable for other built-in programs > > > it shouldn't modify argv, but instead take both argc and argv (so we > > > don't need to have code like "*++(*argv)" ;), parse _all_ options in > > > one go, and return the index (of argv) for any remaining options. > > > > We _have_ to modify argv. For example, "git log master -p" is > > perfectly valid. > > Ah, yes this could be nice to also finally have (more universally) in > git. But for this to be possible I don't see any reason for it to modify > the pointer to argv. Instead, it can just reshuffle entries in argv. In that case, I misunderstood you. Indeed, I'd only reshuffle the entries of argv. Ciao, Dscho