From bf8567afc1b5449a1158a10bc60020309e662dd6 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 28 Jan 2021 21:07:24 -0700 Subject: [PATCH] gitweb/gitweb_config.perl: allow replace refs in gitweb Although the rest of Girocco tries very carefully to avoid being misled by any "replace" refs by making sure GIT_NO_REPLACE_OBJECTS has been set to "1" and exported into the environment, that's not really the best user experience when browsing the repository via gitweb. Since gitweb picks up the standard Girocco environment configuration via Girocco::Config and that *does* always set GIT_NO_REPLACE_REFS=1, gitweb has been running in a mode where it ignores all replace refs (if any are present). Remedy this by adding a little bit extra to gitweb/gitweb_config.perl to remove the GIT_NO_REPLACE_REFS=1 setting from the environment. With this change, gitweb now takes into account any replace refs (refs/replace/*) that may be present in the repository. Note that since git-browser never uses Girocco::Config, it has always been showing the graph with the effect of any replace refs present. Now gitweb's display will match that of git-browser's and be less of a surprise when replace refs are present in a repository. Signed-off-by: Kyle J. McKay --- gitweb/gitweb_config.perl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gitweb/gitweb_config.perl b/gitweb/gitweb_config.perl index 494bf82..1a7a600 100644 --- a/gitweb/gitweb_config.perl +++ b/gitweb/gitweb_config.perl @@ -266,5 +266,10 @@ git_add_config("core.packedGitLimit", "256m"); git_add_config("core.bigFileThreshold", "16m"); git_add_config("gc.auto", "0"); +# Since we actually want to display "replaced" commits in +# gitweb just the same as git-browser does, make sure that +# GIT_NO_REPLACE_OBJECTS is NOT set in the environment for gitweb. +delete $ENV{'GIT_NO_REPLACE_OBJECTS'}; + # This should not be needed, but just in case, make the last expression true 1; -- 2.11.4.GIT