threads / discuss / 16032

git-daemon and hook output

Subject: git-daemon and hook output

## tl;dr

3 messages between Oct 24, 2008 and Oct 24, 2008.

replies: 2people: 3as markdown or json

Joey Hess· Oct 24, 2008, 05:07 UTC · lore

According to githooks, standard output/error for the post-receive and pre-receive hooks will be seen by the user. This is true if using ssh. But if git-daemon has been configured to allow pushes, the user will not see anything these hooks output, and only a not very helpful

 ! [remote rejected] master -> master (pre-receive hook declined)

I suppose that to fix this, git-daemon would have to select on stdout and stderr and pipe them over the wire to the client. Apologies for not even trying to write a patch to do that.

(I ran into this in a real-world application -- I'm implementing anonymous pushes into ikiwiki, which are checked pre-receive to limit them to changes that could be done via the web interface. So all my nice error messages about why a commit is refused are not available, which is a pity.)

-- 
see shy jo
Miklos Vajna· Oct 24, 2008, 20:39 UTC · re: Joey Hess · lore

Re: git-daemon and hook output

On Fri, Oct 24, 2008 at 01:07:13AM -0400, Joey Hess <joey@kitenet.net> wrote:
Show 5 quoted lines
> I ran into this in a real-world application -- I'm implementing
> anonymous pushes into ikiwiki, which are checked pre-receive to limit
> them to changes that could be done via the web interface. So all my nice
> error messages about why a commit is refused are not available, which is
> a pity.

I think the recommended protocol even for anonymous push is ssh, at least that's what repo.or.cz uses for the 'mob' user, which is equivalent to anonymous, AFAIK.

(The source is available under repo.git, I did not have a look how one can set up an account - using git-shell - that can be used without a password.)

Shawn O. Pearce· Oct 24, 2008, 20:42 UTC · re: Miklos Vajna · lore

Re: git-daemon and hook output

Miklos Vajna <vmiklos@frugalware.org> wrote:
Show 10 quoted lines
> On Fri, Oct 24, 2008 at 01:07:13AM -0400, Joey Hess <joey@kitenet.net> wrote:
> > I ran into this in a real-world application -- I'm implementing
> > anonymous pushes into ikiwiki, which are checked pre-receive to limit
> > them to changes that could be done via the web interface. So all my nice
> > error messages about why a commit is refused are not available, which is
> > a pity.
> 
> I think the recommended protocol even for anonymous push is ssh, at
> least that's what repo.or.cz uses for the 'mob' user, which is
> equivalent to anonymous, AFAIK.

Nah. git:// supports anonymous push. For some applications its just what people want. I say the original change is worthwhile; expose the remote address and let a hook do logging and/or denials based on its own logic.

-- 
Shawn.

← back to recent threads