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

Re: Add "--dirstat" for some directory statistics

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 11, 2008, 21:17 UTC
Message-ID
<alpine.LFD.1.00.0802111302470.2920@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.1.00.0802111230200.2920@woody.linux-foundation.org>
On Mon, 11 Feb 2008, Linus Torvalds wrote:
> 
> The reporting limit has been arbitrarily set at 3%, which seems to be a 
> pretty good cut-off, but I made it an option variable in case anybody 
> would ever want to make it a dynamic cutoff.

Side note: that 3% isn't actually _too_ arbitrary. I did actually test things a bit.

So it seems to be a good limit that ensures that you'll basically never see more than one page worth of reporting (if you did, it wouldn't be a very good summary). So in theory, if something is _just_ right and really balanced out across a wide variety of directories, you can get 33 lines of output, but in practice it's unusual to get more than 10-15 entries.

In the kernel, the most spread out commit I've found so far is 18 entries:
    CONFIG_HIGHPTE vs. sub-page page tables.
   3% arch/powerpc/mm/
   5% arch/sparc/mm/
   6% arch/
   5% include/asm-alpha/
   3% include/asm-avr32/
   3% include/asm-cris/
   4% include/asm-ia64/
   6% include/asm-m68k/
   3% include/asm-mips/
   7% include/asm-powerpc/
   6% include/asm-sh/
   4% include/asm-sparc64/
   3% include/asm-um/
   6% include/asm-x86/
   3% include/asm-xtensa/
   3% include/linux/
  14% include/
   7% mm/
 53 files changed, 326 insertions(+), 132 deletions(-)

but it's not like I looked through all of them (and I'm sure you can get more if you select just the right commit range to generate the diff).

The point being that a 4-percent cut-off would likely be so big that it would have hidden the details in the above example.

A 2% cut-off is worth trying, though. It does get a bit more detail, and the likelihood of it actually causing a 50-line report is probably vanishingly small, so it might be worth playing around with. The above 18-entry example grows to 23 entries with a 2% limit, which is very borderline on a traditional 80x24 terminal, but still just barely "one page" which was my personal rule to aim for.

			Linus
Previous: Linus TorvaldsNext: Johannes Schindelin
Message 2 of 6 in “Add "--dirstat" for some directory statistics”
  1. Linus TorvaldsFeb 11, 2008
  2. Linus TorvaldsFeb 11, 2008
  3. Johannes SchindelinFeb 11, 2008
  4. Linus TorvaldsFeb 11, 2008
  5. Linus TorvaldsFeb 11, 2008
  6. Linus TorvaldsFeb 11, 2008

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.