Remove common-cmds.h

After the last patch, common-cmds.h is no longer used (and it was actually broken). Remove all related code. command-list.h will take its place from now on. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed May 10, 2018 at 10:46 UTC 60f487ac0ef1165932211ede29ea661c79984b16
3 files changed +9 -55
.gitignore
-1
@@ -179,7 +179,6 @@
179 /gitweb/gitweb.cgi
180 /gitweb/static/gitweb.js
181 /gitweb/static/gitweb.min.*
182 -/common-cmds.h
182 /command-list.h
183 *.tar.gz
184 *.dsc
Makefile
+6 -11
@@ -757,7 +757,7 @@ LIB_FILE = libgit.a
757 XDIFF_LIB = xdiff/lib.a
758 VCSSVN_LIB = vcs-svn/lib.a
759
760 -GENERATED_H += common-cmds.h command-list.h
760 +GENERATED_H += command-list.h
761
762 LIB_H = $(shell $(FIND) . \
763 -name .git -prune -o \
@@ -1914,9 +1914,9 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
1914 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
1915 $(filter %.o,$^) $(LIBS)
1916
1917 -help.sp help.s help.o: common-cmds.h command-list.h
1917 +help.sp help.s help.o: command-list.h
1918
1919 -builtin/help.sp builtin/help.s builtin/help.o: common-cmds.h command-list.h GIT-PREFIX
1919 +builtin/help.sp builtin/help.s builtin/help.o: command-list.h GIT-PREFIX
1920 builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
1921 '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
1922 '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
@@ -1935,11 +1935,6 @@ $(BUILT_INS): git$X
1935 ln -s $< $@ 2>/dev/null || \
1936 cp $< $@
1937
1938 -common-cmds.h: generate-cmdlist.sh command-list.txt
1939 -
1940 -common-cmds.h: $(wildcard Documentation/git-*.txt)
1941 - $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt COMMON >$@+ && mv $@+ $@
1942 -
1938 command-list.h: generate-cmdlist.sh command-list.txt
1939
1940 command-list.h: $(wildcard Documentation/git-*.txt)
@@ -2153,7 +2148,7 @@ else
2148 # Dependencies on header files, for platforms that do not support
2149 # the gcc -MMD option.
2150 #
2156 -# Dependencies on automatically generated headers such as common-cmds.h or command-list.h
2151 +# Dependencies on automatically generated headers such as command-list.h
2152 # should _not_ be included here, since they are necessary even when
2153 # building an object for the first time.
2154
@@ -2532,7 +2527,7 @@ sparse: $(SP_OBJ)
2527 style:
2528 git clang-format --style file --diff --extensions c,h
2529
2535 -check: common-cmds.h command-list.h
2530 +check: command-list.h
2531 @if sparse; \
2532 then \
2533 echo >&2 "Use 'make sparse' instead"; \
@@ -2780,7 +2775,7 @@ clean: profile-clean coverage-clean
2775 $(RM) $(TEST_PROGRAMS) $(NO_INSTALL)
2776 $(RM) -r bin-wrappers $(dep_dirs)
2777 $(RM) -r po/build/
2783 - $(RM) *.pyc *.pyo */*.pyc */*.pyo common-cmds.h command-list.h $(ETAGS_TARGET) tags cscope*
2778 + $(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*
2779 $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
2780 $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
2781 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
generate-cmdlist.sh
+3 -43
@@ -68,46 +68,6 @@ struct cmdname_help {
68 uint32_t category;
69 };
70 "
71 -if test -z "$2"
72 -then
73 - define_categories "$1"
74 - echo
75 - print_command_list "$1"
76 - exit 0
77 -fi
78 -
79 -echo "static const char *common_cmd_groups[] = {"
80 -
81 -grps=grps$$.tmp
82 -match=match$$.tmp
83 -trap "rm -f '$grps' '$match'" 0 1 2 3 15
84 -
85 -sed -n '
86 - 1,/^### common groups/b
87 - /^### command list/q
88 - /^#/b
89 - /^[ ]*$/b
90 - h;s/^[^ ][^ ]*[ ][ ]*\(.*\)/ N_("\1"),/p
91 - g;s/^\([^ ][^ ]*\)[ ].*/\1/w '$grps'
92 - ' "$1"
93 -printf '};\n\n'
94 -
95 -n=0
96 -substnum=
97 -while read grp
98 -do
99 - echo "^git-..*[ ]$grp"
100 - substnum="$substnum${substnum:+;}s/[ ]$grp/$n/"
101 - n=$(($n+1))
102 -done <"$grps" >"$match"
103 -
104 -printf 'static struct cmdname_help common_cmds[] = {\n'
105 -grep -f "$match" "$1" |
106 -sed 's/^git-//' |
107 -sort |
108 -while read cmd tags
109 -do
110 - tag=$(echo "$tags" | sed "$substnum; s/[^0-9]//g")
111 - echo " {\"$cmd\", $(get_synopsis git-$cmd), $tag},"
112 -done
113 -echo "};"
71 +define_categories "$1"
72 +echo
73 +print_command_list "$1"