From 588ae809287c6c02e53fb0227bc3c4c6239d4561 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Fri, 4 Oct 2013 00:37:44 +0200 Subject: git-notify: Replace "-S" with "-G" Before: -S Enable compatibility with SourceForge's gitweb URLs After: -G Don't append .git extension to repository names in gitweb URLs The new option behaves like the old one, this change should just clarify that this is not specific to SourceForge. diff --git a/libexec/git-notify b/libexec/git-notify index 60d91ae..cce476e 100755 --- a/libexec/git-notify +++ b/libexec/git-notify @@ -77,8 +77,8 @@ my $abbreviate_url = git_config( "notify.shorturls" ); # don't report merge commits (can be set with the -X option) my $ignore_merges = git_config( "notify.ignoremerges" ); -# enable compatibility with SourceForge's gitweb (can be set with the -S option) -my $sourceforge = git_config( "notify.sourceforge" ); +# don't append ".git" to repository name in gitweb URLs (can be set with the -G option) +my $no_git_extension = git_config( "notify.nogitextension" ); # default repository name (can be changed with the -r option) my $repos_name = git_config( "notify.repository" ) || get_repos_name(); @@ -113,10 +113,10 @@ sub usage() print " -A Omit the author name from the mail subject\n"; print " -C Show committer in the body if different from the author\n"; print " -c name Send CIA notifications under specified project name\n"; + print " -G Don't append .git extension to repository names in gitweb URLs\n"; print " -m addr Send mail notifications to specified address\n"; print " -n max Set max number of individual mails to send\n"; print " -r name Set the git repository name\n"; - print " -S Enable compatibility with SourceForge's gitweb URLs\n"; print " -s bytes Set the maximum diff size in bytes (-1 for no limit)\n"; print " -T Prefix the mail subject with a [repository name] tag\n"; print " -t file Prevent duplicate notifications by saving state to this file\n"; @@ -302,10 +302,10 @@ sub parse_options() elsif ($arg eq '-A') { $omit_author = 1; } elsif ($arg eq '-C') { $show_committer = 1; } elsif ($arg eq '-c') { $cia_project_name = shift @ARGV; } + elsif ($arg eq '-G') { $no_git_extension = 1; } elsif ($arg eq '-m') { $commitlist_address = shift @ARGV; } elsif ($arg eq '-n') { $max_individual_notices = shift @ARGV; } elsif ($arg eq '-r') { $repos_name = shift @ARGV; } - elsif ($arg eq '-S') { $sourceforge = 1; } elsif ($arg eq '-s') { $max_diff_size = shift @ARGV; } elsif ($arg eq '-T') { $emit_repo = 1; } elsif ($arg eq '-t') { $state_file = shift @ARGV; } @@ -662,7 +662,7 @@ umask( $mode_mask ); # append repository path to URL if ($gitweb_url) { - $gitweb_url .= $sourceforge ? "/$repos_name" : "/$repos_name.git"; + $gitweb_url .= $no_git_extension ? "/$repos_name" : "/$repos_name.git"; } if (@ARGV) diff --git a/libexec/post-receive.d/01-mail-notify b/libexec/post-receive.d/01-mail-notify index f3b4e77..d9ef967 100755 --- a/libexec/post-receive.d/01-mail-notify +++ b/libexec/post-receive.d/01-mail-notify @@ -36,5 +36,6 @@ exec "$gitnotify" \ -u "$gitweburl" \ -A \ -C \ + -G \ -T \ -z -- cgit v0.10-9-g596f