From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] for-each-ref: introduce %(upstream:track[short])
Date: Wed, 13 Nov 2013 11:42:12 -0800 [thread overview]
Message-ID: <xmqqk3gcdr6z.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1384335406-16332-3-git-send-email-artagnon@gmail.com> (Ramkumar Ramachandra's message of "Wed, 13 Nov 2013 15:06:45 +0530")
You need to squash 78465bb, which has been queued on the previous
round, in to this step. There also is a similar issue introduced by
the updated 3/3:
builtin/for-each-ref.c: In function 'populate_value':
builtin/for-each-ref.c:701:13: error: 'refname' may be used uninitialized in this function [-Werror=uninitialized]
700 if (!strcmp(formatp, "short"))
701 refname = shorten_unambiguous_ref(refname,
702 warn_ambiguous_refs);
Thanks.
-- >8 --
Date: Thu, 31 Oct 2013 14:17:36 -0700
Subject: [PATCH] fixup! for-each-ref: introduce %(upstream:track[short])
The condition !prefixcmp(name, "upstream") must be true for the
variable "branch" to be reused, so the variable should be always set
when it gets used, but GCC does not seem to realize this fact.
---
builtin/for-each-ref.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index ed81407..67168a1 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -641,7 +641,7 @@ static void populate_value(struct refinfo *ref)
int deref = 0;
const char *refname;
const char *formatp;
- struct branch *branch;
+ struct branch *branch = NULL;
if (*name == '*') {
deref = 1;
@@ -719,6 +719,7 @@ static void populate_value(struct refinfo *ref)
} else if (!strcmp(formatp, "trackshort") &&
!prefixcmp(name, "upstream")) {
+ assert(branch != NULL);
stat_tracking_info(branch, &num_ours, &num_theirs);
if (!num_ours && !num_theirs)
v->s = "=";
--
1.8.5-rc1-322-g9c05f5a
next prev parent reply other threads:[~2013-11-13 19:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 9:36 [PATCH v2 0/3] Minor f-e-r enhacements Ramkumar Ramachandra
2013-11-13 9:36 ` [PATCH v2 1/3] for-each-ref: introduce %(HEAD) asterisk marker Ramkumar Ramachandra
2013-11-13 9:36 ` [PATCH v2 2/3] for-each-ref: introduce %(upstream:track[short]) Ramkumar Ramachandra
2013-11-13 19:42 ` Junio C Hamano [this message]
2013-11-13 19:44 ` Junio C Hamano
2013-11-14 6:53 ` Ramkumar Ramachandra
2013-11-13 9:36 ` [PATCH v2 3/3] for-each-ref: introduce %(color:...) for color Ramkumar Ramachandra
2013-11-13 20:01 ` Junio C Hamano
2013-11-13 20:19 ` Junio C Hamano
2013-11-14 7:03 ` Ramkumar Ramachandra
2013-11-18 16:24 ` Junio C Hamano
2013-11-18 16:45 ` Ramkumar Ramachandra
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=xmqqk3gcdr6z.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.