From mboxrd@z Thu Jan 1 00:00:00 1970 From: "=?ISO-8859-1?Q?Santi_B=E9jar?=" Subject: Re: [PATCH] git help: sort commands by topi Date: Mon, 18 Feb 2008 18:16:00 +0100 Message-ID: <8aa486160802180916t3807d505g9ed85c18d8884649@mail.gmail.com> References: <87hcg77i6i.fsf@gmail.com> <7vlk5ipo3c.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org To: "Junio C Hamano" X-From: git-owner@vger.kernel.org Mon Feb 18 18:16:58 2008 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 1JR9bg-0004s1-Na for gcvg-git-2@gmane.org; Mon, 18 Feb 2008 18:16:45 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615AbYBRRQH (ORCPT ); Mon, 18 Feb 2008 12:16:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752600AbYBRRQF (ORCPT ); Mon, 18 Feb 2008 12:16:05 -0500 Received: from gv-out-0910.google.com ([216.239.58.186]:35235 "EHLO gv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298AbYBRRQE (ORCPT ); Mon, 18 Feb 2008 12:16:04 -0500 Received: by gv-out-0910.google.com with SMTP id s4so195324gve.37 for ; Mon, 18 Feb 2008 09:16:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=CQRa26AI8fzyeu80bz4+E0PYnMalj7CKbMGv2sg7994=; b=gqD0gBh3PVgreIGq+dVTy4x4AiMgc0/A+P6hkO4uPztzpHjjcJvjtEOnaRTpNEL1JzSY/s/XMUAdqyVqcUNaHRcSz5gqXiaLEYvv57W4l2g+A1cNRHwNscJORqhtQxKMY6J5pvTfJFQ00jOCqoXX3lJ8KaqC2cUDhkEsa+4HZds= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bQDLEVVioyY0HcRmfgoDf+qHzow6cfZiPAifi50JS4XPSOp6696OzRnBqzJwhlCz62HNqfzAQHZ7KUZHgxOKXaK1/gH2F652PVd+DcvaIHlzhq8yuHwX2D6GQ3AckAbo1z2ew/AV6S4pEvbgoAgJ1/l+1VL3dGljokX5/M6yRpI= Received: by 10.150.192.7 with SMTP id p7mr2113474ybf.21.1203354960813; Mon, 18 Feb 2008 09:16:00 -0800 (PST) Received: by 10.150.205.9 with HTTP; Mon, 18 Feb 2008 09:16:00 -0800 (PST) In-Reply-To: <7vlk5ipo3c.fsf@gitster.siamese.dyndns.org> Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Feb 18, 2008 11:15 AM, Junio C Hamano wrote: > "Santi Bejar" writes: > > diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh > > index a2913c2..ec623dd 100755 > > --- a/generate-cmdlist.sh > > +++ b/generate-cmdlist.sh > > @@ -3,22 +3,36 @@ > > echo "/* Automatically generated by $0 */ > > struct cmdname_help > > { > > - char name[16]; > > + char name[23]; > > char help[80]; > > + char topic[22]; > > + char subtopic[10]; > > }; > > These limits are very magic. If you are generating them in the > script perhaps you would want to count bytes? > They were already there. Maybe in a cleanup patch. > I dunno. Honestly, I am not very interested in this patch > myself. > > Side Note: my not being interested does not mean I > strongly oppose to its inclusion (I do not even care). > It is just that I won't be the one who will be pushing > for its inclusion, and you would want supporters other > than me to push for it. OK. > > > -static struct cmdname_help common_cmds[] = {" > > +struct topicname_help > > +{ > > + char name[23]; > > + char subtopic[10]; > > + char help[80]; > > +}; > > Likewise. > > > -sed -n -e 's/^git-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | > > -sort | > > -while read cmd > > +static struct cmdname_help cmd_list[] = {" > > + > > +sed -n -e 's/^git-\([^ ]*\)\(.*\)$/\1\2/p' command-list.txt | > > +grep -v deprecated | sort | > > +while read cmd topic subtopic > > I do not like this pipeline to send output of sed to an _overly_ > loose grep. What happens when we introduce "git-deprecated" > command later? I'll look at it. [...] > > ${ > > x > > - s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ > > + s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1",/ > > p > > }' "Documentation/git-$cmd.txt" > > + echo "\"$topic\", \"$subtopic\" }," > > Breaks nicely indented entries like: > > {"add", "Add file contents... > Sorry, but I do not undestand this. [...] > > diff --git a/topic-list.txt b/topic-list.txt > > new file mode 100644 > > index 0000000..2ba11a9 > > --- /dev/null > > +++ b/topic-list.txt > > @@ -0,0 +1,12 @@ > > +# List of known git topics. > > +# topic name help > > +common The most commonly used commands > > +mainporcelain Main porcelain commands > > ... > > +synchelpers Synching helper commands > > +purehelpers Internal helper commands > > I wonder if this can be shared with the section headings of > Documentation/git.txt; either generate the section headings from > this file, or generate this file from the section headings. I'll look at it. Thanks for the review. Santi