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

Re: [PATCH 3/3] diff --stat: sometimes use non-linear scaling.

From
Martin Waitz <tali@admingilde.org>
Date
Sep 28, 2006, 08:17 UTC
Message-ID
<20060928081757.GF8056@admingilde.org>
In-Reply-To
<Pine.LNX.4.64.0609270810470.3952@g5.osdl.org>
hoi :)
On Wed, Sep 27, 2006 at 08:12:49AM -0700, Linus Torvalds wrote:
Show 8 quoted lines
> No _way_ is it correct to show more than three characters if there were 
> three lines of changes.
> 
> I think "nonlinear" is fine, but this is something that is "superlinear" 
> in small changes, and then sublinear in bigger ones (and then apparently 
> totally wrong for one-line changes).
> 
> It should at least never be superlinear, I believe.
So if we want to keep the logarithmic scale we can do some maths:
Assume we use a formula ala
	length = a log(change + b) + c
with three invariants a, b, and c.

We want to scale linearly at first, but want to reach width at max_change:

	0 = a log(b) + c
	1 = a log(b + 1) + c
	width = a log(max_change + b) + c

But only I have not succeeded in solving these equations, I always stop at the last invariant :-(

-- 
Martin Waitz
Previous: Linus TorvaldsNext: Junio C Hamano
Message 14 of 18 in “diff --stat: sometimes use non-linear scaling.”
  1. 3/3 diff --stat: sometimes use non-linear scaling.Junio C Hamano, Sep 27, 2006
  2. David RientjesSep 27, 2006
  3. Junio C HamanoSep 27, 2006
  4. David RientjesSep 27, 2006
  5. Junio C HamanoSep 27, 2006
  6. David RientjesSep 27, 2006
  7. Junio C HamanoSep 27, 2006
  8. David RientjesSep 27, 2006
  9. Johannes SchindelinSep 27, 2006
  10. Petr BaudisOct 6, 2006
  11. Johannes SchindelinSep 27, 2006
  12. Martin WaitzSep 27, 2006
  13. Linus TorvaldsSep 27, 2006
  14. Martin WaitzSep 28, 2006
  15. Junio C HamanoSep 28, 2006
  16. Andreas EricssonSep 29, 2006
  17. Johannes SchindelinSep 27, 2006
  18. SeanSep 27, 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.