From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: Implementing branch attributes in git config Date: Mon, 08 May 2006 18:18:51 -0700 Message-ID: <7v1wv4c7wk.fsf@assigned-by-dhcp.cox.net> References: <1147037659.25090.25.camel@dv> <1147048587.17371.13.camel@dv> <7vfyjli9vf.fsf@assigned-by-dhcp.cox.net> <7vbqu9i6zl.fsf@assigned-by-dhcp.cox.net> <7virogc90u.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue May 09 03:19:11 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FdGsM-0002ai-Rd for gcvg-git@gmane.org; Tue, 09 May 2006 03:19:02 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751335AbWEIBSx (ORCPT ); Mon, 8 May 2006 21:18:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751336AbWEIBSx (ORCPT ); Mon, 8 May 2006 21:18:53 -0400 Received: from fed1rmmtao01.cox.net ([68.230.241.38]:26284 "EHLO fed1rmmtao01.cox.net") by vger.kernel.org with ESMTP id S1751335AbWEIBSw (ORCPT ); Mon, 8 May 2006 21:18:52 -0400 Received: from assigned-by-dhcp.cox.net ([68.4.9.127]) by fed1rmmtao01.cox.net (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20060509011851.LLAI25692.fed1rmmtao01.cox.net@assigned-by-dhcp.cox.net>; Mon, 8 May 2006 21:18:51 -0400 To: Linus Torvalds In-Reply-To: (Linus Torvalds's message of "Mon, 8 May 2006 18:05:13 -0700 (PDT)") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Linus Torvalds writes: > On Mon, 8 May 2006, Junio C Hamano wrote: >> >> Wait a minute... Statefulness is not the issue, I think. > > Well, it does end up being.. Not really, you ended up making it so, perhaps, but I do not think it needs to be. You dodged my comments on the SQL-like queries ;-). I was half (perhaps 3/4) joking, but some people actually might like to be able to say: git repo-config --get-all branch.name where url like 'git://%' to list all the repositories reachable via git-native protocol. Oops, by the way, why does a [branch] have url as its attribute? I think this was a bad example -- we are talking about [remote] here. But the main point is about syntax, so that is OK. > Exactly, git repo-config would have to know about this magic thing, and > have a special argument like > > --state=branch.name > > that says that "state" is to be taken from the "branch.name" variable when > seen. > > Then, in addition to the regexp, you would have a way to trigger on the > "state" variable. I am reluctant to buy that argument (I see it is an easy way from the implementation point of view) -- it appears to me that it would invite this easy user error. [branch] name = linus url = git://git.kernel.org/../torvalds/linux-2.6 [branch] url = git://git.kernel.org/../jgarzik/libata-dev name = libata > It would be _able_ to do all the same things, but thanks to statefulness > you'd be able to keep the section (and key) names the way they are. Yes, but that statefulness is inviting user errors, and you need to update repo-config and config parser anyway, so I still do not see what the advantage is.