git/Documentation/technical
Taylor Blau 20c49432e4 Documentation/technical/bitmap-format.txt: add missing position table
While investigating a benign Coverity warning on the new pseudo-merge
implementation, I was struggling to understand the (paraphrased) below:

    ofs = index_end - 24 - (index->pseudo_merges.nr * sizeof(uint64_t));
    for (i = 0; i < index->pseudo_merges.nr; i++) {
            index->pseudo_merges.v[i].at = get_be64(ofs);
            ofs += sizeof(uint64_t);
    }

, in pack-bitmap.c::load_bitmap_header(). Looking at the documentation,
the diagram describing the on-disk format (prior to this patch)
suggested that the optional extended lookup table immediately preceded
the trailing metadata portion.

If that were the case, that would make the above code from
load_bitmap_header() incorrect, as we'd be blindly reading into the
extended offset table.

But later on in the documentation there is a description of the
pseudo-merge position table as immediately preceding the trailing
metadata portion of the extension. And indeed, we do write the position
table in pack-bitmap-write.c:

    /* write positions for all pseudo merges */
    for (i = 0; i < writer->pseudo_merges_nr; i++)
            hashwrite_be64(f, pseudo_merge_ofs[i]);

    hashwrite_be32(f, writer->pseudo_merges_nr);
    hashwrite_be32(f, kh_size(writer->pseudo_merge_commits));
    hashwrite_be64(f, table_start - start);
    hashwrite_be64(f, hashfile_total(f) - start + sizeof(uint64_t));

So this is purely a case of the diagram being out of sync with the
textual description and actual implementation of the format
specification.

Add the missing component back to the format diagram to avoid further
confusion in this area.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-06-14 14:19:26 -07:00
..
.gitignore
api-error-handling.txt api docs: link to html version of api-trace2 2022-09-16 08:39:11 -07:00
api-index-skel.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
api-index.sh
api-merge.txt merge-ll: rename from ll-merge 2023-06-21 13:39:54 -07:00
api-parse-options.txt Documentation: clean up various typos in technical docs 2022-09-21 10:28:36 -07:00
api-simple-ipc.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
api-trace2.txt trace2: add global counter mechanism 2022-10-24 12:45:26 -07:00
bitmap-format.txt Documentation/technical/bitmap-format.txt: add missing position table 2024-06-14 14:19:26 -07:00
bundle-uri.txt bundle-uri: drop bundle.flag from design doc 2023-01-31 08:57:48 -08:00
commit-graph.txt documentation: fix typos 2023-10-09 12:06:24 -07:00
directory-rename-detection.txt directory-rename-detection.txt: small updates due to merge-ort optimizations 2021-08-05 08:57:39 -07:00
hash-function-transition.txt Documentation: render dash correctly 2023-01-23 09:40:14 -08:00
long-running-process-protocol.txt docs: move protocol-related docs to man section 5 2022-08-04 14:12:23 -07:00
multi-pack-index.txt midx.c: make changing the preferred pack safe 2022-01-27 12:07:52 -08:00
pack-heuristics.txt
packfile-uri.txt docs: move protocol-related docs to man section 5 2022-08-04 14:12:23 -07:00
parallel-checkout.txt documentation: add missing quotes 2023-10-09 12:06:47 -07:00
partial-clone.txt documentation: add missing article 2023-10-09 12:06:29 -07:00
racy-git.txt documentation: fix singular vs. plural 2023-10-09 12:06:29 -07:00
reftable.txt documentation: add some commas where they are helpful 2023-10-09 12:06:44 -07:00
remembering-renames.txt docs: typofixes 2023-06-12 13:52:51 -07:00
repository-version.txt refs: introduce reftable backend 2024-02-07 08:28:37 -08:00
rerere.txt documentation: remove extraneous words 2023-10-09 12:06:29 -07:00
scalar.txt Documentation/technical: include Scalar technical doc 2022-09-02 10:02:56 -07:00
send-pack-pipeline.txt
shallow.txt shallow.txt: document SHA-256 shallow format 2020-08-17 10:35:13 -07:00
sparse-checkout.txt sparse-checkout.txt: new document with sparse-checkout directions 2022-11-07 18:15:45 -05:00
sparse-index.txt sparse-index: API protection strategy 2021-04-14 13:45:34 -07:00
trivial-merge.txt
unit-tests.txt unit tests: add a project plan document 2023-11-10 08:15:25 +09:00