Re: [PATCH] git-daemon: more powerful base-path/user-path settings, using formats.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Sunday, August 27, 2006 - 3:52 am

Pierre Habouzit <madcoder@debian.org> writes:


I have to admit that I kinda liked JDL's simpler one first (and
it has been in production use for some time).  We'll see.

About vger potentially throwing things away, I use this script
(called "taboo.perl") to check my messages before sending them
out.

Obviously the taboo-word list itself is not attached here, but
the actual script should have a copy of it after the __DATA__
marker.

-- >8 --

#!/usr/bin/perl -w

my $tmpl = '	if (%%PATTERN%%) {
		print "$lineno ${_}matches %%QPATTERN%%\n";
		return;
	}
';
my $stmt = "";
my $in_header = 1;

while (<DATA>) {
	if (/^\$global_taboo_body =/) {
		$in_header = 0;
	}
	next if (/^\043/ || /^\$/ || /^END$/ || /^\s*$/);
	chomp;
	my $p = $_;
	if ($in_header) {
		$p = '/^[-\w_]*:/ && ' . $p;
	}
	my $q = quotemeta($p);
	my $stmt1 = $tmpl;
	$stmt1 =~ s|%%PATTERN%%|$p|g;
	$stmt1 =~ s|%%QPATTERN%%|$q|g;
	$stmt .= $stmt1;
}
close DATA;

$stmt = 'sub check {
	my ($line, $lineno) = @_;
' . $stmt . '
}
';
eval $stmt;
while (<>) {
	check($_, $.);
}

my $how_to_update_this_script = <<'EOF' ;
	( sed -e '/^__DATA__$$/q' taboo.perl && \
	  wget -q -O - http://vger.kernel.org/majordomo-taboos.txt ) \
		>taboo.perl+
	if diff -u taboo.perl taboo.perl+; \
	then \
		rm -f taboo.perl+; \
		echo >&2 No changes.; \
	else \
		mv taboo.perl+ taboo.perl; \
		chmod +x taboo.perl; \
	fi
EOF

__DATA__

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git-daemon virtual hosting implementation., Pierre Habouzit, (Wed Aug 23, 11:52 am)
Re: [PATCH] git-daemon virtual hosting implementation., Junio C Hamano, (Wed Aug 23, 1:11 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Pierre Habouzit, (Wed Aug 23, 1:56 pm)
Re: [PATCH] git-daemon: more powerful base-path/user-path ..., Pierre Habouzit, (Thu Aug 24, 12:50 am)
Re: [PATCH] git-daemon virtual hosting implementation., Jon Loeliger, (Thu Aug 24, 1:15 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Jon Loeliger, (Thu Aug 24, 1:34 pm)
Re: [PATCH] git-daemon virtual hosting implementation., Junio C Hamano, (Thu Aug 24, 1:35 pm)
Re: [PATCH] git-daemon: more powerful base-path/user-path ..., Junio C Hamano, (Sun Aug 27, 3:52 am)
Re: [PATCH] git-daemon: more powerful base-path/user-path ..., Randal L. Schwartz, (Sun Aug 27, 9:06 am)