git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-name-rev: allow --name-only in combination with --stdin

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 1, 2008, 10:57 UTC
Message-ID
<alpine.DEB.1.00.0808011256330.9611@pacific.mpi-cbg.de.mpi-cbg.de>
In-Reply-To
<7vtze5td00.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 1 Aug 2008, Junio C Hamano wrote:
Show 8 quoted lines
> Pieter de Bie <pdebie@ai.rug.nl> writes:
> 
> > Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
> > ---
> >
> > 	Or was there a specific reason not to allow this?
> 
> I'll let Dscho answer that one.
... who let's Shawn answer that one.
Show 24 quoted lines
> > 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

Previous: Junio C HamanoNext: Pieter de Bie
Message 3 of 8 in “git-name-rev: allow --name-only in combination with --stdin”
  1. git-name-rev: allow --name-only in combination with --stdinPieter de Bie, Jul 31, 2008
  2. Junio C HamanoAug 1, 2008
  3. Johannes SchindelinAug 1, 2008
  4. builtin-name-rev: refactor stdin handling to its own functionPieter de Bie, Aug 1, 2008
  5. Junio C HamanoAug 1, 2008
  6. Junio C HamanoAug 2, 2008
  7. git-name-rev: don't use printf without formatRené Scharfe, Aug 3, 2008
  8. Junio C HamanoAug 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.