Re: [PATCH] git-blame: Make the output human readable
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 5, 2006, 14:23 UTC
- Message-ID
- <Pine.LNX.4.63.0603051516020.12866@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <20060305123800.GD23448@c165.ib.student.liu.se>
Hi,
On Sun, 5 Mar 2006, Fredrik Kuivinen wrote:
Show 14 quoted lines
> On Sun, Mar 05, 2006 at 04:10:47AM -0800, Junio C Hamano wrote: > > Fredrik Kuivinen <freku045@student.liu.se> 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