git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] Have git-cvsserver call hooks/update before really altering the ref

From
Junio C Hamano <junkio@cox.net>
Date
Feb 14, 2007, 05:36 UTC
Message-ID
<7v4pppuwpv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200702131512.45412.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 16 quoted lines
> diff --git a/git-cvsserver.perl b/git-cvsserver.perl
> index 9371788..b4ef6bc 100755
> --- a/git-cvsserver.perl
> +++ b/git-cvsserver.perl
> @@ -1171,6 +1171,21 @@ sub req_ci
>          exit;
>      }
>  
> +	# Check that this is allowed, just as we would with a receive-pack
> +	my @cmd = ( $ENV{GIT_DIR}.'hooks/update', "refs/heads/$state->{module}",
> +			$parenthash, $commithash );
> +	if( -x $cmd[0] ) {
> +		unless( system( @cmd ) == 0 )
> +		{
> +			$log->warn("Commit failed (update hook declined to update ref)");
> +			print "error 2 Commit failed (update hook declined)\n";

Everybody else seems to say 'print "error 1 blah blah"'. Are you sure "error 2 message" is Kosher protocol-wise?

Previous: Andy ParkinsNext: Andy Parkins
Message 6 of 9 in “Have git-cvsserver call hooks/update before really altering the ref”
  1. Have git-cvsserver call hooks/update before really altering the refAndy Parkins, Feb 13, 2007
  2. Junio C HamanoFeb 13, 2007
  3. Nicolas PitreFeb 13, 2007
  4. Junio C HamanoFeb 13, 2007
  5. Andy ParkinsFeb 13, 2007
  6. Junio C HamanoFeb 14, 2007
  7. Andy ParkinsFeb 14, 2007
  8. Junio C HamanoFeb 14, 2007
  9. Martin LanghoffFeb 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.