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

Re: history damage in linux.git

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 21, 2016, 19:43 UTC
Message-ID
<CA+55aFxESRnvr76n601X8dJhZT4qTpiF3GphNhvK2hh4O_GChg@mail.gmail.com>
In-Reply-To
<xmqqmvomsqwx.fsf@gitster.mtv.corp.google.com>
On Thu, Apr 21, 2016 at 12:27 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
>> But this patch is small and simple, and has some excuses for its
>> behavior. What do people think?
>
> I like it that you call it "excuse" not "rationale", as I couldn't
> form a logical connection between your "4 (2) letters" and "10000
> (100)" at all ;-)

Think of the distance number as a "order of magnitude in complexity", and it actually makes a certain amount of sense.

It's not the same as the length of the string, but the "log()" of the distance number really does give a kind of complexity value.

Think of it this way: if things are entirely linear (all just first parenthood), there will be just a single simple number, and the relationship between the simple distance number (that just increments by one for each parent traversed) and the length of the string that describes it will really be "log10(distance)". That's literally how many characters you need to describe the linear distance number.

So a simple linear distance of 'n' commits will need on the order of 'log10(n)' digits to describe it (ie a number around a thousand will need around three digits).

The "100" and "10000" are just extending that notion of distance to the more complex cases., and expresses their complexity in the same logarithmic units. The same way you need four digits to express a _linear_ distance of 10000, you need four characters to express that "~n^p" case of "merge parent p, n generations back".

And if you don't have the generation thing, you only need two characters to express parent #'p': "^p".

So two characters really *are* equivalent to ~100 linear steps, and four characters really *are* equivalent to ~10000 linear steps.

So it's not _just_ an excuse. There's an actual rationale for picking those numbers, and why they are equivalent in a complexity measure.

             Linus
Previous: Junio C Hamano
Message 24 of 24 in “history damage in linux.git”
  1. Olaf HeringApr 21, 2016
  2. Matthieu MoyApr 21, 2016
  3. Olaf HeringApr 21, 2016
  4. Matthieu MoyApr 21, 2016
  5. John KeepingApr 21, 2016
  6. Olaf HeringApr 21, 2016
  7. Matthieu MoyApr 21, 2016
  8. Andreas SchwabApr 21, 2016
  9. Linus TorvaldsApr 21, 2016
  10. Junio C HamanoApr 21, 2016
  11. Jeff KingApr 21, 2016
  12. Linus TorvaldsApr 21, 2016
  13. Stefan BellerApr 21, 2016
  14. Junio C HamanoApr 21, 2016
  15. Jeff KingApr 21, 2016
  16. Linus TorvaldsApr 21, 2016
  17. Johannes SchindelinApr 22, 2016
  18. Linus TorvaldsApr 21, 2016
  19. Junio C HamanoApr 21, 2016
  20. Linus TorvaldsApr 21, 2016
  21. Linus TorvaldsApr 21, 2016
  22. Jeff KingApr 21, 2016
  23. Junio C HamanoApr 21, 2016
  24. Linus TorvaldsApr 21, 2016

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.