From: Tay Ray Chuan <rctay89@gmail.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] Add push --set-upstream
Date: Sat, 16 Jan 2010 23:30:43 +0800 [thread overview]
Message-ID: <20100116233043.26a5636d.rctay89@gmail.com> (raw)
In-Reply-To: <20100116134656.GA4504@Knoppix>
Hi,
On Sat, 16 Jan 2010 15:46:57 +0200
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
> > Regarding the checking of ref->status here:
> >
> > Is it possible to delegate this to push_had_errors(remote_refs)
> > instead? We skip setting up upstream tracking when there are errors
> > from pushing, so we don't have to check ref->status anymore.
>
> No. As documetnation says, the update or no update is done on per-branch
> basis.
>
> <snip patch>
I see. If that's the case, could you also allow setting up upstream
tracking when ref->status is 'none' and not consider it errorneous?
After all, push_had_errors() does not consider 'none' errorneous.
I think a switch block might be neater too.
@@ -149,9 +149,15 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
* Check suitability for tracking. Must be successful /
* already up-to-date ref create/modify (not delete).
*/
- if (ref->status != REF_STATUS_OK &&
- ref->status != REF_STATUS_UPTODATE)
+ switch (ref->status) {
+ case REF_STATUS_NONE:
+ case REF_STATUS_UPTODATE:
+ case REF_STATUS_OK:
+ ; /* no-op */
+ default:
continue;
+ }
if (!ref->peer_ref)
continue;
if (!ref->new_sha1 || is_null_sha1(ref->new_sha1))
--
Cheers,
Ray Chuan
next prev parent reply other threads:[~2010-01-16 15:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-16 9:23 [PATCH v3] Add push --set-upstream Ilari Liusvaara
2010-01-16 12:35 ` Tay Ray Chuan
2010-01-16 13:46 ` Ilari Liusvaara
2010-01-16 15:30 ` Tay Ray Chuan [this message]
2010-01-16 15:56 ` Ilari Liusvaara
2010-01-16 16:13 ` Tay Ray Chuan
2010-01-16 18:12 ` Tay Ray Chuan
2010-01-16 18:28 ` Jeff King
2010-01-16 18:39 ` Tay Ray Chuan
2010-01-16 16:47 ` Junio C Hamano
2010-01-16 18:43 ` Tay Ray Chuan
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=20100116233043.26a5636d.rctay89@gmail.com \
--to=rctay89@gmail.com \
--cc=git@vger.kernel.org \
--cc=ilari.liusvaara@elisanet.fi \
/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).