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

Re: [PATCH] fast-import: export correctly marks larger than 2^20-1

From
Shawn Pearce <spearce@spearce.org>
Date
Aug 10, 2010, 14:20 UTC
Message-ID
<AANLkTiniC0JeeZZeYSTg7M6WuhzJzChiqZ+9EBMoZwxQ@mail.gmail.com>
In-Reply-To
<1279021908-21291-1-git-send-email-harinath@hurrynot.org>
On Tue, Jul 13, 2010 at 4:51 AM, Raja R Harinath <harinath@hurrynot.org> wrote:
Show 18 quoted lines
> dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
> i.e., when the sparse array has more than two levels.  The bug was
> that the 'base' counter was being shifted by 20 bits at level 3, and
> then again by 10 bits at level 2, rather than a total shift of 20 bits
> in this argument to the recursive call:
>
>  (base + k) << m->shift
>
> There are two ways to fix this correctly, the elegant:
>
>  (base + k) << 10
>
> and the one I chose due to edit distance:
>
>  base + (k << m->shift)
>
> Cc: Shawn O. Pearce <spearce@spearce.org>
> Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Dang, that's a very old bug.  This change makes sense, thanks.
Acked-by: Shawn O. Pearce <spearce@spearce.org>
-- 
Shawn.
Previous: Raja R Harinath
Message 4 of 4 in “fast-import: export correctly marks larger than 2^20-1”
  1. fast-import: export correctly marks larger than 2^20-1Raja R Harinath, Jul 13, 2010
  2. Jonathan NiederJul 13, 2010
  3. Raja R HarinathJul 14, 2010
  4. Shawn PearceAug 10, 2010

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.