diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-11-29 15:41:50 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-11-29 15:41:50 -0800 |
commit | ad1260b6c994f7c0f9c259bd39f39979f7f4ecc2 (patch) | |
tree | 178477065b014826267a1f39a8447a4ac58c0949 | |
parent | Merge branch 'tb/plug-pack-bitmap-leaks' (diff) | |
parent | git-sh-setup: remove "sane_grep", it's not needed anymore (diff) | |
download | tgif-ad1260b6c994f7c0f9c259bd39f39979f7f4ecc2.tar.xz |
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)
-rw-r--r-- | Makefile | 26 | ||||
-rw-r--r-- | config.mak.uname | 1 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | contrib/buildsystems/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | git-filter-branch.sh | 2 | ||||
-rwxr-xr-x | git-instaweb.sh | 9 | ||||
-rw-r--r-- | git-sh-setup.sh | 8 |
7 files changed, 14 insertions, 41 deletions
@@ -305,9 +305,6 @@ all:: # # Define NO_TCLTK if you do not want Tcl/Tk GUI. # -# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep -# and egrep that are pickier when their input contains non-ASCII data. -# # The TCL_PATH variable governs the location of the Tcl interpreter # used to optimize git-gui for your system. Only used if NO_TCLTK # is not set. Defaults to the bare 'tclsh'. @@ -2252,33 +2249,30 @@ command-list.h: $(wildcard Documentation/git*.txt) hook-list.h: generate-hooklist.sh Documentation/githooks.txt $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@ -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):$(SANE_TEXT_GREP):$(PAGER_ENV):\ +SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\ + $(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ + $(gitwebdir_SQ):$(PERL_PATH_SQ):$(PAGER_ENV):\ $(perllibdir_SQ) +GIT-SCRIPT-DEFINES: FORCE + @FLAGS='$(SCRIPT_DEFINES)'; \ + if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ + echo >&2 " * new script parameters"; \ + echo "$$FLAGS" >$@; \ + fi + define cmd_munge_script sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ -e 's|@@DIFF@@|$(DIFF_SQ)|' \ -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ - -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \ -e $(BROKEN_PATH_FIX) \ -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \ -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ - -e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \ -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \ $@.sh >$@+ endef -GIT-SCRIPT-DEFINES: FORCE - @FLAGS='$(SCRIPT_DEFINES)'; \ - if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ - echo >&2 " * new script parameters"; \ - echo "$$FLAGS" >$@; \ - fi - - $(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES $(QUIET_GEN)$(cmd_munge_script) && \ chmod +x $@+ && \ diff --git a/config.mak.uname b/config.mak.uname index 3236a4918a..d0701f9beb 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -58,7 +58,6 @@ ifeq ($(uname_S),Linux) # -lrt is needed for clock_gettime on glibc <= 2.16 NEEDS_LIBRT = YesPlease HAVE_GETDELIM = YesPlease - SANE_TEXT_GREP=-a FREAD_READS_DIRECTORIES = UnfortunatelyYes BASIC_CFLAGS += -DHAVE_SYSINFO PROCFS_EXECUTABLE_PATH = /proc/self/exe diff --git a/configure.ac b/configure.ac index 031e8d3fee..5ee25ec95c 100644 --- a/configure.ac +++ b/configure.ac @@ -507,14 +507,6 @@ if test -n "$ASCIIDOC"; then esac fi -if grep -a ascii configure.ac >/dev/null; then - AC_MSG_RESULT([Using 'grep -a' for sane_grep]) - SANE_TEXT_GREP=-a -else - SANE_TEXT_GREP= -fi -GIT_CONF_SUBST([SANE_TEXT_GREP]) - ## Checks for libraries. AC_MSG_NOTICE([CHECKS for libraries]) # diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index fd1399c440..86b4611446 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -781,7 +781,6 @@ foreach(script ${git_shell_scripts}) string(REPLACE "@@USE_GETTEXT_SCHEME@@" "" content "${content}") string(REPLACE "# @@BROKEN_PATH_FIX@@" "" content "${content}") string(REPLACE "@@PERL@@" "${PERL_PATH}" content "${content}") - string(REPLACE "@@SANE_TEXT_GREP@@" "-a" content "${content}") string(REPLACE "@@PAGER_ENV@@" "LESS=FRX LV=-c" content "${content}") file(WRITE ${CMAKE_BINARY_DIR}/${script} ${content}) endforeach() diff --git a/git-filter-branch.sh b/git-filter-branch.sh index cb89372813..3a51d4507c 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -579,7 +579,7 @@ if [ "$filter_tag_name" ]; then git hash-object -t tag -w --stdin) || die "Could not create new tag object for $ref" if git cat-file tag "$ref" | \ - sane_grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1 + grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1 then warn "gpg signature stripped from tag object $sha1t" fi diff --git a/git-instaweb.sh b/git-instaweb.sh index 7c55229773..4349566c89 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -49,7 +49,7 @@ resolve_full_httpd () { *apache2*|*lighttpd*|*httpd*) # yes, *httpd* covers *lighttpd* above, but it is there for clarity # ensure that the apache2/lighttpd command ends with "-f" - if ! echo "$httpd" | sane_grep -- '-f *$' >/dev/null 2>&1 + if ! echo "$httpd" | grep -- '-f *$' >/dev/null 2>&1 then httpd="$httpd -f" fi @@ -380,10 +380,7 @@ TypesConfig "$fqgitdir/mime.types" DirectoryIndex gitweb.cgi EOF - # check to see if Dennis Stosberg's mod_perl compatibility patch - # (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied - if test -f "$module_path/mod_perl.so" && - sane_grep 'MOD_PERL' "$root/gitweb.cgi" >/dev/null + if test -f "$module_path/mod_perl.so" then # favor mod_perl if available cat >> "$conf" <<EOF @@ -402,7 +399,7 @@ EOF # plain-old CGI resolve_full_httpd list_mods=$(echo "$full_httpd" | sed 's/-f$/-l/') - $list_mods | sane_grep 'mod_cgi\.c' >/dev/null 2>&1 || \ + $list_mods | grep 'mod_cgi\.c' >/dev/null 2>&1 || \ if test -f "$module_path/mod_cgi.so" then echo "LoadModule cgi_module $module_path/mod_cgi.so" >> "$conf" diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 960982f9d5..b93f39288c 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -173,14 +173,6 @@ git_pager() { eval "$GIT_PAGER" '"$@"' } -sane_grep () { - GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@" -} - -sane_egrep () { - GREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ "$@" -} - is_bare_repository () { git rev-parse --is-bare-repository } |