Skip to content

Commit ad1260b

Browse files
committed
Merge branch 'ab/sh-retire-helper-functions'
Make a few helper functions unused and then lose them. * ab/sh-retire-helper-functions: git-sh-setup: remove "sane_grep", it's not needed anymore git-sh-setup: remove unused sane_egrep() function git-instaweb: unconditionally assume that gitweb is mod_perl capable Makefile: remove $(NO_CURL) from $(SCRIPT_DEFINES) Makefile: remove $(GIT_VERSION) from $(SCRIPT_DEFINES) Makefile: move git-SCRIPT-DEFINES adjacent to $(SCRIPT_DEFINES)
2 parents 49767c3 + ebeb39f commit ad1260b

File tree

7 files changed

+14
-41
lines changed

7 files changed

+14
-41
lines changed

Makefile

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ all::
305305
#
306306
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
307307
#
308-
# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep
309-
# and egrep that are pickier when their input contains non-ASCII data.
310-
#
311308
# The TCL_PATH variable governs the location of the Tcl interpreter
312309
# used to optimize git-gui for your system. Only used if NO_TCLTK
313310
# is not set. Defaults to the bare 'tclsh'.
@@ -2252,33 +2249,30 @@ command-list.h: $(wildcard Documentation/git*.txt)
22522249
hook-list.h: generate-hooklist.sh Documentation/githooks.txt
22532250
$(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@
22542251

2255-
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
2256-
$(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
2257-
$(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
2252+
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\
2253+
$(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
2254+
$(gitwebdir_SQ):$(PERL_PATH_SQ):$(PAGER_ENV):\
22582255
$(perllibdir_SQ)
2256+
GIT-SCRIPT-DEFINES: FORCE
2257+
@FLAGS='$(SCRIPT_DEFINES)'; \
2258+
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
2259+
echo >&2 " * new script parameters"; \
2260+
echo "$$FLAGS" >$@; \
2261+
fi
2262+
22592263
define cmd_munge_script
22602264
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
22612265
-e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
22622266
-e 's|@@DIFF@@|$(DIFF_SQ)|' \
22632267
-e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
2264-
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
22652268
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
22662269
-e $(BROKEN_PATH_FIX) \
22672270
-e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
22682271
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
2269-
-e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \
22702272
-e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
22712273
22722274
endef
22732275

2274-
GIT-SCRIPT-DEFINES: FORCE
2275-
@FLAGS='$(SCRIPT_DEFINES)'; \
2276-
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
2277-
echo >&2 " * new script parameters"; \
2278-
echo "$$FLAGS" >$@; \
2279-
fi
2280-
2281-
22822276
$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
22832277
$(QUIET_GEN)$(cmd_munge_script) && \
22842278
chmod +x $@+ && \

config.mak.uname

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ ifeq ($(uname_S),Linux)
5858
# -lrt is needed for clock_gettime on glibc <= 2.16
5959
NEEDS_LIBRT = YesPlease
6060
HAVE_GETDELIM = YesPlease
61-
SANE_TEXT_GREP=-a
6261
FREAD_READS_DIRECTORIES = UnfortunatelyYes
6362
BASIC_CFLAGS += -DHAVE_SYSINFO
6463
PROCFS_EXECUTABLE_PATH = /proc/self/exe

configure.ac

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -507,14 +507,6 @@ if test -n "$ASCIIDOC"; then
507507
esac
508508
fi
509509

510-
if grep -a ascii configure.ac >/dev/null; then
511-
AC_MSG_RESULT([Using 'grep -a' for sane_grep])
512-
SANE_TEXT_GREP=-a
513-
else
514-
SANE_TEXT_GREP=
515-
fi
516-
GIT_CONF_SUBST([SANE_TEXT_GREP])
517-
518510
## Checks for libraries.
519511
AC_MSG_NOTICE([CHECKS for libraries])
520512
#

contrib/buildsystems/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ foreach(script ${git_shell_scripts})
781781
string(REPLACE "@@USE_GETTEXT_SCHEME@@" "" content "${content}")
782782
string(REPLACE "# @@BROKEN_PATH_FIX@@" "" content "${content}")
783783
string(REPLACE "@@PERL@@" "${PERL_PATH}" content "${content}")
784-
string(REPLACE "@@SANE_TEXT_GREP@@" "-a" content "${content}")
785784
string(REPLACE "@@PAGER_ENV@@" "LESS=FRX LV=-c" content "${content}")
786785
file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content})
787786
endforeach()

git-filter-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ if [ "$filter_tag_name" ]; then
579579
git hash-object -t tag -w --stdin) ||
580580
die "Could not create new tag object for $ref"
581581
if git cat-file tag "$ref" | \
582-
sane_grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1
582+
grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1
583583
then
584584
warn "gpg signature stripped from tag object $sha1t"
585585
fi

git-instaweb.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ resolve_full_httpd () {
4949
*apache2*|*lighttpd*|*httpd*)
5050
# yes, *httpd* covers *lighttpd* above, but it is there for clarity
5151
# ensure that the apache2/lighttpd command ends with "-f"
52-
if ! echo "$httpd" | sane_grep -- '-f *$' >/dev/null 2>&1
52+
if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1
5353
then
5454
httpd="$httpd -f"
5555
fi
@@ -380,10 +380,7 @@ TypesConfig "$fqgitdir/mime.types"
380380
DirectoryIndex gitweb.cgi
381381
EOF
382382

383-
# check to see if Dennis Stosberg's mod_perl compatibility patch
384-
# (<[email protected]>) has been applied
385-
if test -f "$module_path/mod_perl.so" &&
386-
sane_grep 'MOD_PERL' "$root/gitweb.cgi" >/dev/null
383+
if test -f "$module_path/mod_perl.so"
387384
then
388385
# favor mod_perl if available
389386
cat >> "$conf" <<EOF
@@ -402,7 +399,7 @@ EOF
402399
# plain-old CGI
403400
resolve_full_httpd
404401
list_mods=$(echo "$full_httpd" | sed 's/-f$/-l/')
405-
$list_mods | sane_grep 'mod_cgi\.c' >/dev/null 2>&1 || \
402+
$list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \
406403
if test -f "$module_path/mod_cgi.so"
407404
then
408405
echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf"

git-sh-setup.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ git_pager() {
173173
eval "$GIT_PAGER" '"$@"'
174174
}
175175
176-
sane_grep () {
177-
GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@"
178-
}
179-
180-
sane_egrep () {
181-
GREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ "$@"
182-
}
183-
184176
is_bare_repository () {
185177
git rev-parse --is-bare-repository
186178
}

0 commit comments

Comments
 (0)