Skip to content

Commit 60f487a

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cfb22a0 commit 60f487a

File tree

3 files changed

+9
-55
lines changed

3 files changed

+9
-55
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@
179179
/gitweb/gitweb.cgi
180180
/gitweb/static/gitweb.js
181181
/gitweb/static/gitweb.min.*
182-
/common-cmds.h
183182
/command-list.h
184183
*.tar.gz
185184
*.dsc

Makefile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ LIB_FILE = libgit.a
757757
XDIFF_LIB = xdiff/lib.a
758758
VCSSVN_LIB = vcs-svn/lib.a
759759

760-
GENERATED_H += common-cmds.h command-list.h
760+
GENERATED_H += command-list.h
761761

762762
LIB_H = $(shell $(FIND) . \
763763
-name .git -prune -o \
@@ -1914,9 +1914,9 @@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
19141914
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
19151915
$(filter %.o,$^) $(LIBS)
19161916

1917-
help.sp help.s help.o: common-cmds.h command-list.h
1917+
help.sp help.s help.o: command-list.h
19181918

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
19201920
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
19211921
'-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
19221922
'-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
@@ -1935,11 +1935,6 @@ $(BUILT_INS): git$X
19351935
ln -s $< $@ 2>/dev/null || \
19361936
cp $< $@
19371937

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-
19431938
command-list.h: generate-cmdlist.sh command-list.txt
19441939

19451940
command-list.h: $(wildcard Documentation/git-*.txt)
@@ -2153,7 +2148,7 @@ else
21532148
# Dependencies on header files, for platforms that do not support
21542149
# the gcc -MMD option.
21552150
#
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
21572152
# should _not_ be included here, since they are necessary even when
21582153
# building an object for the first time.
21592154

@@ -2532,7 +2527,7 @@ sparse: $(SP_OBJ)
25322527
style:
25332528
git clang-format --style file --diff --extensions c,h
25342529

2535-
check: common-cmds.h command-list.h
2530+
check: command-list.h
25362531
@if sparse; \
25372532
then \
25382533
echo >&2 "Use 'make sparse' instead"; \
@@ -2780,7 +2775,7 @@ clean: profile-clean coverage-clean
27802775
$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)
27812776
$(RM) -r bin-wrappers $(dep_dirs)
27822777
$(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*
27842779
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
27852780
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
27862781
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz

generate-cmdlist.sh

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -68,46 +68,6 @@ struct cmdname_help {
6868
uint32_t category;
6969
};
7070
"
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"

0 commit comments

Comments
 (0)