From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "ddrowley3\@juno.com" <ddrowley3@juno.com>,
Daniel Barkalow <barkalow@iabervon.org>,
git@vger.kernel.org
Subject: Re: git-push segfault
Date: Wed, 24 Feb 2010 11:26:10 -0800 [thread overview]
Message-ID: <7vljeio2p9.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20100224170853.GA4756@coredump.intra.peff.net> (Jeff King's message of "Wed\, 24 Feb 2010 12\:08\:53 -0500")
Jeff King <peff@peff.net> writes:
> ... On
> the other hand, branch->merge_name _does_ have one element, so perhaps
> it is an error in the caller to assume that branch->merge_nr and
> branch->merge necessarily correspond.
I think this is a sensible thing to do. branch_has_merge_config() could
be used here but I do not see a point, as the code already knows branch is
non NULL and there are many other places that checks !!branch->merge
themselves.
It may be worth adding a helper function that a caller can lazily sanity
check the set of configuration around a given branch, but that sanity
check will probably go way beyond what branch_has_merge_config() currently
does, so I would think that would be a separate patch after somebody
audits what current non-users of branch_has_merge_config() want. For
example, builtin-branch.c not only makes sure branch->merge is non NULL
but also wants branch->merge[0] and branch->merge[0]->dst exists, and
encapsulating only the first two out of four checks it does by using
branch_has_merge_config() does not add much value to it..
Thanks.
next prev parent reply other threads:[~2010-02-24 19:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-24 16:27 git-push segfault ddrowley3
2010-02-24 17:08 ` Jeff King
2010-02-24 18:05 ` Daniel Barkalow
2010-02-24 19:26 ` Junio C Hamano [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-02-24 3:46 Dale Rowley
2010-02-24 6:02 ` Dale Rowley
2010-02-24 6:36 ` Jeff King
2010-02-24 8:22 ` Andreas Krey
2010-02-24 9:23 ` Jeff King
2010-02-24 10:49 ` Andreas Krey
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=7vljeio2p9.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=ddrowley3@juno.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).