From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Oakley Subject: [PATCH 06/13] Add guide-list.txt and extraction shell Date: Sat, 23 Feb 2013 23:05:54 +0000 Message-ID: <1361660761-1932-7-git-send-email-philipoakley@iee.org> References: <1361660761-1932-1-git-send-email-philipoakley@iee.org> To: GitList X-From: git-owner@vger.kernel.org Sun Feb 24 00:06:28 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U9OAX-0002d7-Nd for gcvg-git-2@plane.gmane.org; Sun, 24 Feb 2013 00:06:14 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759371Ab3BWXFm (ORCPT ); Sat, 23 Feb 2013 18:05:42 -0500 Received: from out1.ip04ir2.opaltelecom.net ([62.24.128.240]:3202 "EHLO out1.ip04ir2.opaltelecom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759353Ab3BWXFh (ORCPT ); Sat, 23 Feb 2013 18:05:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABpKKVFZ8rke/2dsb2JhbABFwVGBCBdzgiABBVYzCEk5HgYTiBe+eY8Vg0ADpyKDBw X-IronPort-AV: E=Sophos;i="4.84,724,1355097600"; d="scan'208";a="400995031" Received: from host-89-242-185-30.as13285.net (HELO localhost) ([89.242.185.30]) by out1.ip04ir2.opaltelecom.net with ESMTP; 23 Feb 2013 23:05:35 +0000 X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1361660761-1932-1-git-send-email-philipoakley@iee.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: The guide-list.txt uses exactly the same format as command-list.txt so could be merged as part of a refactoring. The category naming for each guide is an initial suggestion and is not yet used. Only those with the 'guide' prefix are copied by the generate-guidelist.sh into the common-guides.h file. The user-manual.txt and everyday.txt do not have the correct filename format yet. And gitrepository-layout.txt name is too long to include. So comment them out. Signed-off-by: Philip Oakley --- The shell script function N_() does not appear to work correctly on my Ubuntu lash-up, so an simpler script line is used with the original commented out. --- generate-guidelist.sh | 23 +++++++++++++++++++++++ guide-list.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 generate-guidelist.sh create mode 100644 guide-list.txt diff --git a/generate-guidelist.sh b/generate-guidelist.sh new file mode 100644 index 0000000..c0c98eb --- /dev/null +++ b/generate-guidelist.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Usage: ./generate-guidelist.sh >>common-guides.h +# based on generate-cmdlist.sh +echo "/* Automatically generated by $0 */ +/* re-use struct cmdname_help in common-commands.h */ + +static struct cmdname_help common_guides[] = {" + +sed -n -e 's/^git\([^ ]*\)[ ].* guide.*/\1/p' guide-list.txt | +sort | +while read guide +do + sed -n ' + /^NAME/,/git'"$guide"'/H + ${ + x +# s/.*git'"$guide"' - \(.*\)/ {"'"$guide"'", N_("\1")},/ + s/.*git'"$guide"' - \(.*\)/ {"'"$guide"'", "\1"},/ + p + }' "Documentation/git$guide.txt" +done +echo "};" + diff --git a/guide-list.txt b/guide-list.txt new file mode 100644 index 0000000..a419ac4 --- /dev/null +++ b/guide-list.txt @@ -0,0 +1,29 @@ +# List of known git guides. +# guide name category [deprecated] [common] [guide] +gitattributes concept guide +gitcore-tutorial specialist +gitcredentials specialist +gitcvs-migration specialist +gitdiffcore specialist +gitglossary reference guide +githooks specialist +gitignore concept guide +gitmodules concept guide +gitnamespaces specialist +#gitrepository-layout reference guide +gitrevisions concept guide +gittutorial user guide +gittutorial-2 user +gitweb.conf specialist +gitweb specialist +gitworkflows user guide + +#giteveryday user guide +#gituser-manual user guide + +# could embed inside common-cmds.h with [guide] as the second thing, +# making the sed's in generate-cmdlist.sh more obvious +# but drop the dash in 's/^git-\ + +#gitrepository-layout is too long for the current char[16] +# -- 1.8.1.msysgit.1