Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread René Scharfe
Am 23.03.2017 um 20:39 schrieb Jeff King: On Thu, Mar 23, 2017 at 12:33:06PM -0700, Junio C Hamano wrote: Nice, but why add the "if" when it's doing nothing? It's short-circuiting in the conditional. I think René meant this: /* just for side effects */ skip_prefix(name, "refs/hea

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread SZEDER Gábor
On Thu, Mar 23, 2017 at 8:39 PM, Jeff King wrote: > On Thu, Mar 23, 2017 at 12:33:06PM -0700, Junio C Hamano wrote: > >> >> Nice, but why add the "if" when it's doing nothing? >> > >> > It's short-circuiting in the conditional. >> >> I think René meant this: >> >> /* just for side effects */

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Junio C Hamano
Jeff King writes: > On Thu, Mar 23, 2017 at 12:33:06PM -0700, Junio C Hamano wrote: > >> >> Nice, but why add the "if" when it's doing nothing? >> > >> > It's short-circuiting in the conditional. >> >> I think René meant this: >> >> /* just for side effects */ >> skip_prefix(name, "re

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Junio C Hamano
René Scharfe writes: >> I think René meant this: >> >> /* just for side effects */ >> skip_prefix(name, "refs/heads/", &name) || >> skip_prefix(name, "refs/tags/", &name) || >> skip_prefix(name, "refs/remotes/", &name); >> >> return name; >> >> which still short-sircuits,

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Jeff King
On Thu, Mar 23, 2017 at 12:33:06PM -0700, Junio C Hamano wrote: > >> Nice, but why add the "if" when it's doing nothing? > > > > It's short-circuiting in the conditional. > > I think René meant this: > > /* just for side effects */ > skip_prefix(name, "refs/heads/", &name) || > sk

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread René Scharfe
Am 23.03.2017 um 20:33 schrieb Junio C Hamano: Jeff King writes: On Thu, Mar 23, 2017 at 08:18:26PM +0100, René Scharfe wrote: Am 23.03.2017 um 16:50 schrieb SZEDER Gábor: This eliminates three magic numbers. Signed-off-by: SZEDER Gábor --- refs.c | 10 +- 1 file changed, 5 inser

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Junio C Hamano
Jeff King writes: > On Thu, Mar 23, 2017 at 08:18:26PM +0100, René Scharfe wrote: > >> Am 23.03.2017 um 16:50 schrieb SZEDER Gábor: >> > This eliminates three magic numbers. >> > >> > Signed-off-by: SZEDER Gábor >> > --- >> > refs.c | 10 +- >> > 1 file changed, 5 insertions(+), 5 dele

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Stefan Beller
On Thu, Mar 23, 2017 at 12:23 PM, Jeff King wrote: > On Thu, Mar 23, 2017 at 08:18:26PM +0100, René Scharfe wrote: > >> Am 23.03.2017 um 16:50 schrieb SZEDER Gábor: >> > This eliminates three magic numbers. >> > >> > Signed-off-by: SZEDER Gábor >> > --- >> > refs.c | 10 +- >> > 1 file c

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread Jeff King
On Thu, Mar 23, 2017 at 08:18:26PM +0100, René Scharfe wrote: > Am 23.03.2017 um 16:50 schrieb SZEDER Gábor: > > This eliminates three magic numbers. > > > > Signed-off-by: SZEDER Gábor > > --- > > refs.c | 10 +- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a

Re: [PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread René Scharfe
Am 23.03.2017 um 16:50 schrieb SZEDER Gábor: This eliminates three magic numbers. Signed-off-by: SZEDER Gábor --- refs.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index e7606716d..0272e332c 100644 --- a/refs.c +++ b/refs.c @@ -366,11 +366,11

[PATCH] refs.c: use skip_prefix() in prettify_refname()

2017-03-23 Thread SZEDER Gábor
This eliminates three magic numbers. Signed-off-by: SZEDER Gábor --- refs.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index e7606716d..0272e332c 100644 --- a/refs.c +++ b/refs.c @@ -366,11 +366,11 @@ int for_each_glob_ref(each_ref_fn fn, const