git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stephan Beyer <s-beyer@gmx.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, Paolo Bonzini <bonzini@gnu.org>,
	Miklos Vajna <vmiklos@frugalware.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Daniel Barkalow <barkalow@iabervon.org>,
	Christian Couder <chriscool@tuxfamily.org>,
	gitster@pobox.com
Subject: Re: [PATCH 1/2] Move run_hook() from builtin-commit.c into run-command.c (libgit)
Date: Fri, 16 Jan 2009 18:25:21 +0100	[thread overview]
Message-ID: <20090116172521.GD28177@leksak.fem-net> (raw)
In-Reply-To: <alpine.DEB.1.00.0901151637590.3586@pacific.mpi-cbg.de>

Hi,

> > -	ret = start_command(&hook);
> > -	if (ret) {
> > -		warning("Could not spawn %s", argv[0]);
> > -		return ret;
> > -	}
> > -	ret = finish_command(&hook);
> > -	if (ret == -ERR_RUN_COMMAND_WAITPID_SIGNAL)
> > -		warning("%s exited due to uncaught signal", argv[0]);
> 
> What are the side effects of replacing this with "ret = 
> run_command(&hook);"?  This has to be discussed and defended in the commit 
> message.

This is a very good point.
The consequences are that two warnings are missing, but these are
warnings that are useful enough to be included for all those hooks,
imho.

Thanks!

> Lots of improvements possible (I agree; _after_ this patch):
[...]
> - use ALLOC_GROW instead of having a fixed size argv,

Agreed.

> - use an strbuf for the index file

Is that useful in some way?
Currently it would only adds code to generate strbufs at the caller
side. And in the case the caller has a strbuf for the index file, it
can simply use the .buf member.

> - checking executability of argv[0] before filling argv,

Agreed.

Patch series v2 will follow.

Thanks,
  Stephan

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F

  parent reply	other threads:[~2009-01-16 17:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 15:00 [PATCH 1/2] Move run_hook() from builtin-commit.c into run-command.c (libgit) Stephan Beyer
2009-01-15 15:00 ` [PATCH 2/2] api-run-command.txt: talk about run_hook() Stephan Beyer
2009-01-15 15:49   ` Jakub Narebski
2009-01-15 16:12     ` Miklos Vajna
2009-01-15 15:46 ` [PATCH 1/2] Move run_hook() from builtin-commit.c into run-command.c (libgit) Johannes Schindelin
2009-01-15 22:59   ` Junio C Hamano
2009-01-16 17:25   ` Stephan Beyer [this message]
2009-01-16 19:09     ` [PATCH v2 1/5] checkout: don't crash on file checkout before running post-checkout hook Stephan Beyer
2009-01-16 19:09       ` [PATCH v2 2/5] Move run_hook() from builtin-commit.c into run-command.c (libgit) Stephan Beyer
2009-01-16 19:10         ` [PATCH v2 3/5] api-run-command.txt: talk about run_hook() Stephan Beyer
2009-01-16 19:10           ` [PATCH v2 4/5] run_hook(): check the executability of the hook before filling argv Stephan Beyer
2009-01-16 19:10             ` [PATCH 5/5] run_hook(): allow more than 9 hook arguments Stephan Beyer
2009-01-16 21:05               ` Johannes Schindelin
2009-01-17  3:02             ` [PATCH v2 " Stephan Beyer
2009-01-18  1:56       ` [PATCH v2 1/5] checkout: don't crash on file checkout before running post-checkout hook Junio C Hamano
2009-01-18  2:05         ` Stephan Beyer
2009-01-16 20:58     ` [PATCH 1/2] Move run_hook() from builtin-commit.c into run-command.c (libgit) Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090116172521.GD28177@leksak.fem-net \
    --to=s-beyer@gmx.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=bonzini@gnu.org \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    --cc=vmiklos@frugalware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).