git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] docs: add a basic description of the config API
Date: Wed, 8 Feb 2012 10:48:55 -0500	[thread overview]
Message-ID: <20120208154855.GC8773@sigill.intra.peff.net> (raw)
In-Reply-To: <7vmx8tzv3l.fsf@alter.siamese.dyndns.org>

On Tue, Feb 07, 2012 at 10:40:14PM -0800, Junio C Hamano wrote:

> What I was getting at is that we probably should officially declare that
> returning 1 to signal success is perfectly acceptable (and it probably
> should mean the caller who called the callback function as a sub callback
> should return immediately, taking it as a signal that the key has already
> been handled), as the primary purpose of this thread to discuss Peff's
> patch is to write these rules down.
> 
> Of course, all that relies on the audit of the git_config() machinery. I
> think it is written to accept non-negative as success, and that is why I
> said "I too think this should be acceptable" in the first place.

I looked through it the other day when this came up, and I believe that
is the case. There is another related rule that should be considered,
though: should the return value from callbacks be propagated via
git_config to its caller?

It is the case already for config files that are read, but not for
config options parsed from the command line. It would not be too hard to
change, but I do not think any current callers care (as I mentioned
earlier, these days with the "void *" data pointer, sane callers will
simply pass in a pointer to a modifiable data area).

-Peff

  parent reply	other threads:[~2012-02-08 15:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06  9:53 [PATCH 0/2] config includes 3: revenge of the killer includes Jeff King
2012-02-06  9:53 ` [PATCH 1/2] docs: add a basic description of the config API Jeff King
2012-02-06 22:31   ` Junio C Hamano
2012-02-07 18:06     ` Jeff King
2012-02-07 18:23       ` Jeff King
2012-02-07 18:45         ` Junio C Hamano
2012-02-07 18:44       ` Junio C Hamano
2012-02-08  4:01         ` Nguyen Thai Ngoc Duy
2012-02-08  6:40           ` Junio C Hamano
2012-02-08  6:55             ` Nguyen Thai Ngoc Duy
2012-02-08 15:59               ` Jeff King
2012-02-08 15:48             ` Jeff King [this message]
2012-02-07 19:46       ` Jeff King
2012-02-06  9:54 ` [PATCH 2/2] config: add include directive Jeff King
2012-02-06 22:39   ` Junio C Hamano
2012-02-07 18:36     ` Jeff King

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

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

  git send-email \
    --in-reply-to=20120208154855.GC8773@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /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.
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 NNTP newsgroup(s).