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

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

Previous: Fredrik KuivinenNext: Junio C Hamano
Message 4 of 10 in “git-blame: Make the output human readable”
  1. git-blame: Make the output human readableFredrik Kuivinen, Mar 5, 2006
  2. Junio C HamanoMar 5, 2006
  3. Fredrik KuivinenMar 5, 2006
  4. Johannes SchindelinMar 5, 2006
  5. Junio C HamanoMar 5, 2006
  6. Fredrik KuivinenMar 7, 2006
  7. blame: avoid -lm by not using log().Junio C Hamano, Mar 5, 2006
  8. Johannes SchindelinMar 5, 2006
  9. blame and annotate: show localtime with timezone.Junio C Hamano, Mar 5, 2006
  10. Johannes SchindelinMar 5, 2006

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.