{"thread":{"id":"9112","subject":"[PATCH] gitweb cleanup: Move @diff_opts declaration earlier","startedAt":"2007-07-20T00:15:09Z","lastAt":"2007-07-20T00:15:09Z","messageCount":1,"participants":["Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"47910","messageId":"11848905093747-git-send-email-jnareb@gmail.com","threadId":"9112","inReplyTo":null,"subject":"[PATCH] gitweb cleanup: Move @diff_opts declaration earlier","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-07-20T00:15:09Z","receivedAt":"2007-07-20T00:15:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Move @diff_opts declaration earlier, so that all gitweb options are\ntogether (and not separated by %feature hash and some subroutines),\nwith the exception of $GITWEB_CONFIG which must be after all option\nvariables including %feature hash.\n\nWhile at it, in the moved comment, note that diff option '-C' implies\n'-M', instead of suggesting that '-M', '-C' is required.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   20 ++++++++++----------\n 1 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex c8ba3a2..6754e26 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -104,6 +104,16 @@ our $mimetypes_file = undef;\n # could be even 'utf-8' for the old behavior)\n our $fallback_encoding = 'latin1';\n \n+# rename detection options for git-diff and git-diff-tree\n+# - default is '-M', with the cost proportional to\n+#   (number of removed files) * (number of new files).\n+# - more costly is '-C' (which implies '-M'), with the cost proportional to\n+#   (number of changed files + number of removed files) * (number of new files)\n+# - even more costly is '-C', '--find-copies-harder' with cost\n+#   (number of files in the original tree) * (number of new files)\n+# - one might want to include '-B' option, e.g. '-B', '-M'\n+our @diff_opts = ('-M'); # taken from git_commit\n+\n # You define site-wide feature defaults here; override them with\n # $GITWEB_CONFIG as necessary.\n our %feature = (\n@@ -310,16 +320,6 @@ sub check_export_ok {\n \t\t(!$export_ok || -e \"$dir/$export_ok\"));\n }\n \n-# rename detection options for git-diff and git-diff-tree\n-# - default is '-M', with the cost proportional to\n-#   (number of removed files) * (number of new files).\n-# - more costly is '-C' (or '-C', '-M'), with the cost proportional to\n-#   (number of changed files + number of removed files) * (number of new files)\n-# - even more costly is '-C', '--find-copies-harder' with cost\n-#   (number of files in the original tree) * (number of new files)\n-# - one might want to include '-B' option, e.g. '-B', '-M'\n-our @diff_opts = ('-M'); # taken from git_commit\n-\n our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || \"++GITWEB_CONFIG++\";\n do $GITWEB_CONFIG if -e $GITWEB_CONFIG;\n \n-- \n1.5.2.4\n"}]}