From: Johannes Schindelin Date: Fri, 01 Aug 2008 10:57:47 GMT Subject: Re: [PATCH] git-name-rev: allow --name-only in combination with --stdin Message-ID: In-Reply-To: <7vtze5td00.fsf@gitster.siamese.dyndns.org> Hi, On Fri, 1 Aug 2008, Junio C Hamano wrote: > Pieter de Bie writes: > > > Signed-off-by: Pieter de Bie > > --- > > > > Or was there a specific reason not to allow this? > > I'll let Dscho answer that one. ... who let's Shawn answer that one. > > diff --git a/builtin-name-rev.c b/builtin-name-rev.c > > index 85612c4..0536af4 100644 > > --- a/builtin-name-rev.c > > +++ b/builtin-name-rev.c > > @@ -266,8 +266,14 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix) > > if (!name) > > continue; > > > > - fwrite(p_start, p - p_start + 1, 1, stdout); > > - printf(" (%s)", name); > > + if (data.name_only) { > > + fwrite(p_start, p - p_start + 1 - 40, 1, stdout); > > + printf(name); > > + } > > + else { > > + fwrite(p_start, p - p_start + 1, 1, stdout); > > + printf(" (%s)", name); > > + } > > p_start = p + 1; > > } > > } > > Is it just me to find that this part is getting indented too deeply to be > readable? No. Ciao, Dscho