This patch needed on top of 3/3 for me to pass gcc cleanly.
-- >8 --
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
Introduce %(upstream:track) to display "[ahead M, behind N]" and
%(upstream:trackshort) to display "=", ">", "<", or "<>"
appropriately (inspired by contrib/completion/git-prompt.sh).
Now you can use the following format in for-each-ref:
%C(green)%(refname:short)%C(reset)%(upstream:trackshort)
Johannes Sixt wrote:
> Am 9/27/2013 14:10, schrieb Ramkumar Ramachandra:
>> +v->s = xstrdup(buf);
>> +}
>
> These strdupped strings are leaked, right?
The convention seems to be that each refinfo owns its atom_value,
which owns its s
From: "Ramkumar Ramachandra"
Philip Oakley wrote:
"=" and "<>" I can easily understand (binary choice), but ">" and "<"
will
need to be clear which way they indicate in terms of matching
the "[ahead N]" and "[behind M]" options.
The ">" corresponds to ahead, while "<" is behind. You'll get
Philip Oakley wrote:
> "=" and "<>" I can easily understand (binary choice), but ">" and "<" will
> need to be clear which way they indicate in terms of matching
> the "[ahead N]" and "[behind M]" options.
The ">" corresponds to ahead, while "<" is behind. You'll get used to
it pretty quickly :)
- Original Message -
From: "Ramkumar Ramachandra"
Sent: Friday, September 27, 2013 1:10 PM
Introduce %(upstream:track) to display "[ahead M, behind N]" and
%(upstream:trackshort) to display "=", ">", "<", or "<>"
appropriately (inspired by contrib/completion/git-prompt.sh).
Now you can
Johannes Sixt wrote:
>> + else if (!num_ours) {
>> + sprintf(buf, "[behind %d]",
>> num_theirs);
>> + v->s = xstrdup(buf);
>> + } else if (!num_theirs) {
>> +
Phil Hord wrote:
>> --- a/builtin/for-each-ref.c
>> +++ b/builtin/for-each-ref.c
>> @@ -631,6 +631,7 @@ static void populate_value(struct refinfo *ref)
>> int eaten, i;
>> unsigned long size;
>> const unsigned char *tagged;
>> + int upstream_present = 0;
>
> This flag
Am 9/27/2013 14:10, schrieb Ramkumar Ramachandra:
> + else if (!strcmp(formatp, "track") &&
> + !prefixcmp(name, "upstream")) {
> + char buf[40];
> +
> + if (!upstream_present)
> +
On Fri, Sep 27, 2013 at 8:10 AM, Ramkumar Ramachandra
wrote:
> Introduce %(upstream:track) to display "[ahead M, behind N]" and
> %(upstream:trackshort) to display "=", ">", "<", or "<>"
> appropriately (inspired by contrib/completion/git-prompt.sh).
>
> Now you can use the following format in for
Introduce %(upstream:track) to display "[ahead M, behind N]" and
%(upstream:trackshort) to display "=", ">", "<", or "<>"
appropriately (inspired by contrib/completion/git-prompt.sh).
Now you can use the following format in for-each-ref:
%C(green)%(refname:short)%C(reset)%(upstream:trackshort)
Introduce %(upstream:track) to display "[ahead M, behind N]" and
%(upstream:trackshort) to display "=", ">", "<", or "<>"
appropriately (inspired by the contrib/completion/git-prompt.sh).
Now you can use the following format in for-each-ref:
%C(red)%(HEAD)%C(reset)
%C(green)%(refname:short)%C(
12 matches
Mail list logo