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

Re: [PATCH 3/3] log and rev-list: add --graph option

From
Adam Simpkins <adam@adamsimpkins.net>
Date
May 6, 2008, 07:01 UTC
Message-ID
<20080506070135.GA24803@adamsimpkins.net>
In-Reply-To
<7vtzhcgci1.fsf@gitster.siamese.dyndns.org>
On Mon, May 05, 2008 at 11:41:58PM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Adam Simpkins <adam@adamsimpkins.net> writes:
> 
> > diff --git a/builtin-rev-list.c b/builtin-rev-list.c
> > index 476a870..f868290 100644
> > --- a/builtin-rev-list.c
> > +++ b/builtin-rev-list.c
> > ...
> > @@ -96,9 +98,50 @@ static void show_commit(struct commit *commit)
> >  		pretty_print_commit(revs.commit_format, commit,
> >  				    &buf, revs.abbrev, NULL, NULL,
> >  				    revs.date_mode, 0);
> > -		if (buf.len)
> > -			printf("%s%c", buf.buf, hdr_termination);
> > +		if (revs.graph) {
> > ...
> > +		} else {
> > +			if (buf.len) {
> > +				fwrite(buf.buf, sizeof(char), buf.len, stdout);
> > +				putchar('\n');
> 
> Now hdr_termination can never be NUL, iow you broke "rev-list -v -z"?
Whoops.  Sorry about that.  I didn't notice the "-v" option.

(BTW, I don't think the "-z" option comes into play here. Just "rev-list -v" by itself results in a NUL character after each entry instead of a newline.)

> I'll squash in a minimum fix, because otherwise this breaks existing
> tests.
Thanks!
-- 
Adam Simpkins
adam@adamsimpkins.net
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 13 in “log --graph and rev-list --graph”
  1. 0/3 log --graph and rev-list --graphAdam Simpkins, May 4, 2008
  2. 1/3 revision API: split parent rewriting and parent printing optionsAdam Simpkins, May 4, 2008
  3. 2/3 Add history graph APIAdam Simpkins, May 4, 2008
  4. 3/3 log and rev-list: add --graph optionAdam Simpkins, May 4, 2008
  5. graph API: eliminate unnecessary indentationAdam Simpkins, May 5, 2008
  6. Ping YinMay 5, 2008
  7. Junio C HamanoMay 6, 2008
  8. Adam SimpkinsMay 6, 2008
  9. Junio C HamanoMay 6, 2008
  10. bash: Add more option completions for 'git log'Teemu Likonen, May 4, 2008
  11. Ping YinMay 5, 2008
  12. Adam SimpkinsMay 5, 2008
  13. Teemu LikonenMay 6, 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.