From: Adam Simpkins Date: Tue, 06 May 2008 07:01:36 GMT Subject: Re: [PATCH 3/3] log and rev-list: add --graph option 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: > Adam Simpkins 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