From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael J Gruber Subject: [RFC/PATCH 1/5] glossary.h: generate a glossary list from the Makefile Date: Mon, 8 Dec 2014 16:38:55 +0100 Message-ID: References: To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Dec 08 16:39:11 2014 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 1Xy0Oz-0000K8-Cj for gcvg-git-2@plane.gmane.org; Mon, 08 Dec 2014 16:39:09 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752960AbaLHPjE (ORCPT ); Mon, 8 Dec 2014 10:39:04 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:49279 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbaLHPjC (ORCPT ); Mon, 8 Dec 2014 10:39:02 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7D64420BDB for ; Mon, 8 Dec 2014 10:39:02 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Mon, 08 Dec 2014 10:39:02 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:from:to:subject:date :message-id:in-reply-to:references; s=smtpout; bh=qUBks7J/KJq/Uz Bs5ctoNYteylc=; b=NgkSNDGC+1vFHAKnMInmprtrEf6zOMKBvPuspzjJhc7pAv iEg8tEJbQlxAminCq5K+jIKETgpVLenPpQGRmRR0nNj7DsPZUAOZBqhpUAMyoB+E 5ioo3ewkQk5QLQ0u5hPTMhGGKm+x3mCs9G42LuyOv9MlVwIwenRKJw3bIwJug= X-Sasl-enc: X6WQtEL4VlXyvxJ5bf1WpXPqBVNBVA23oonrTj2+/1a1 1418053142 Received: from localhost (unknown [130.75.46.56]) by mail.messagingengine.com (Postfix) with ESMTPA id 2138F680190; Mon, 8 Dec 2014 10:39:02 -0500 (EST) X-Mailer: git-send-email 2.2.0.345.g7041aac In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Generate a header file which lists all terms defined in the glossary in a way suitable for localisation. This will be used by the new glossary command. Signed-off-by: Michael J Gruber --- I also snuck in a change to the clean target, so that we don't have to update it (its definition) as long as we keep GENERATED_H up to date. .gitignore | 1 + Makefile | 7 +++++-- generate-glossary.sh | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 generate-glossary.sh diff --git a/.gitignore b/.gitignore index a052419..fb4ebaa 100644 --- a/.gitignore +++ b/.gitignore @@ -208,6 +208,7 @@ /test-urlmatch-normalization /test-wildmatch /common-cmds.h +/glossary.h *.tar.gz *.dsc *.deb diff --git a/Makefile b/Makefile index 14d5ac1..ae74fdf 100644 --- a/Makefile +++ b/Makefile @@ -627,7 +627,7 @@ LIB_FILE = libgit.a XDIFF_LIB = xdiff/lib.a VCSSVN_LIB = vcs-svn/lib.a -GENERATED_H += common-cmds.h +GENERATED_H += common-cmds.h glossary.h LIB_H = $(shell $(FIND) . \ -name .git -prune -o \ @@ -1649,6 +1649,9 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt common-cmds.h: $(wildcard Documentation/git-*.txt) $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@ +glossary.h: ./generate-glossary.sh Documentation/glossary-content.txt + $(QUIET_GEN)./generate-glossary.sh > $@+ && mv $@+ $@ + SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\ $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ $(gitwebdir_SQ):$(PERL_PATH_SQ) @@ -2356,7 +2359,7 @@ clean: profile-clean coverage-clean $(RM) $(TEST_PROGRAMS) $(NO_INSTALL) $(RM) -r bin-wrappers $(dep_dirs) $(RM) -r po/build/ - $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope* + $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope* $(RM) -r $(GIT_TARNAME) .doc-tmp-dir $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz $(RM) $(htmldocs).tar.gz $(manpages).tar.gz diff --git a/generate-glossary.sh b/generate-glossary.sh new file mode 100755 index 0000000..41f1eb3 --- /dev/null +++ b/generate-glossary.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +echo "/* Automatically generated by $0 */ + +static const char *glossary[] = {" + +sed -n -e 's/^.*\]\]\(.*\)::$/\tN_("\1"),/p' Documentation/glossary-content.txt +echo "};" -- 2.2.0.345.g7041aac