From: Daniel Barkalow <barkalow@iabervon.org>
To: Jeff King <peff@peff.net>
Cc: Pierre Habouzit <madcoder@debian.org>,
Nicolas Pitre <nico@cam.org>, Git ML <git@vger.kernel.org>
Subject: Re: [bug in next ?] git-fetch/git-push issue
Date: Mon, 5 Nov 2007 16:41:37 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0711051620230.7357@iabervon.org> (raw)
In-Reply-To: <20071105210711.GA9176@sigill.intra.peff.net>
On Mon, 5 Nov 2007, Jeff King wrote:
> On Mon, Nov 05, 2007 at 01:17:14PM -0500, Daniel Barkalow wrote:
>
> > I think this is the bit that's wrong. I blame Jeff, in 334f4831. :)
> >
> > The issue is that, in the previous version, we'd hit a continue on the
> > not-an-ancestor message and not reach the update_tracking_ref() section
> > for that ref. In 334f4831, all of the updating is after the loop, and it
> > doesn't filter out the refs that didn't actually get pushed.
>
> Nope, that's not the problem. We _only_ update any tracking refs at all
> if ret == 0, and if we fail to push, then we are setting ret to -2.
That's an odd combination of behavior: we update some of the refs, leave
the ones that didn't work alone, report success on the ones that worked,
but then we forget that some things worked?
If we're going to refuse to update local tracking refs, whose state
doesn't matter much, we should certainly refuse to update the remote refs,
which are probably public and extremely important. If we just pushed and
we fetch, we should see exclusively changes that somebody else (including
hooks remotely) did, not anything that we ourselves did.
> Hrm. Oh wait, it looks like we then totally write over the current value
> of 'ret' when we do pack_objects. Oops.
>
> I'm unclear how to fix this, as I'm not really sure what ret is
> _supposed_ to be communicating. What does the '-2' mean, as compared to
> a '-4'? Should we be doing a 'ret += pack_objects(out, remote_refs)' or
> some other bit-masking magic?
I'd guess -2 is supposed to indicate that there were some errors but some
things may have worked. If pack_objects() or receive_status() fails, we
shouldn't update anything locally (because it won't have been accepted
remotely); otherwise, we should make local updates of every remote efect
we had, even if we end up returning non-zero to indicate that we didn't do
everything asked.
-Daniel
*This .sig left intentionally blank*
next prev parent reply other threads:[~2007-11-05 21:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 17:56 [bug in next ?] git-fetch/git-push issue Pierre Habouzit
2007-11-05 18:17 ` Daniel Barkalow
2007-11-05 21:07 ` Jeff King
2007-11-05 21:41 ` Daniel Barkalow [this message]
2007-11-05 22:55 ` Jeff King
2007-11-05 23:22 ` Junio C Hamano
2007-11-05 23:59 ` Daniel Barkalow
2007-11-05 23:46 ` Daniel Barkalow
2007-11-06 3:26 ` Jeff King
2007-11-05 18:19 ` Pierre Habouzit
2007-11-06 17:56 ` Pierre Habouzit
2007-11-06 18:09 ` Jeff King
2007-11-06 18:23 ` Junio C Hamano
2007-11-06 18:41 ` Jeff King
2007-11-06 19:37 ` Pierre Habouzit
2007-11-07 15:11 ` Pierre Habouzit
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=Pine.LNX.4.64.0711051620230.7357@iabervon.org \
--to=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=madcoder@debian.org \
--cc=nico@cam.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).