From: Johannes Schindelin Date: Sun, 05 Mar 2006 14:23:04 GMT Subject: Re: [PATCH] git-blame: Make the output human readable Message-ID: In-Reply-To: <20060305123800.GD23448@c165.ib.student.liu.se> Hi, On Sun, 5 Mar 2006, Fredrik Kuivinen wrote: > On Sun, Mar 05, 2006 at 04:10:47AM -0800, Junio C Hamano wrote: > > Fredrik Kuivinen writes: > > > > > +git-blame$X: blame.o $(LIB_FILE) > > > + $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ > > > + $(LIBS) -lm > > > + > > > > I wonder what it is about to link this binary different from others... > > > > It uses log(3) to compute the number of digits needed to represent the > last line number. It is probably better to this some other way > though... How about this: - max_digits = 1 + log(num_blame_lines+1)/log(10); + for (i = 10, max_digits = 1; i <= num_blame_lines + 1; + i *= 10, max_digits++); (Totally untested) Hth, Dscho