pack-bitmap-write: support storing pseudo-merge commits
Prepare to write pseudo-merge bitmaps by annotating individual bitmapped
commits (which are represented by the `bitmapped_commit` structure) with
an extra bit indicating whether or not they are a pseudo-merge.
In subsequent commits, pseudo-merge bitmaps will be generated by
allocating a fake commit node with parents covering the full set of
commits represented by the pseudo-merge bitmap. These commits will be
added to the set of "selected" commits as usual, but will be written
specially instead of being included with the rest of the selected
commits.
Mechanically speaking, there are two parts of this change:
- The bitmapped_commit struct gets a new bit indicating whether it is
a pseudo-merge, or an ordinary commit selected for bitmaps.
- A handful of changes to only write out the non-pseudo-merge commits
when enumerating through the selected array (see the new
`bitmap_writer_selected_nr()` function). Pseudo-merge commits appear
after all non-pseudo-merge commits, so it is safe to enumerate
through the selected array like so:
for (i = 0; i < bitmap_writer_selected_nr(); i++)
if (writer.selected[i].pseudo_merge)
BUG("unexpected pseudo-merge");
without encountering the BUG().
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
89f47c45df
commit
0d41b18317
@@ -21,6 +21,7 @@ struct bitmap_disk_header {
|
||||
unsigned char checksum[GIT_MAX_RAWSZ];
|
||||
};
|
||||
|
||||
#define BITMAP_PSEUDO_MERGE (1u<<21)
|
||||
#define NEEDS_BITMAP (1u<<22)
|
||||
|
||||
/*
|
||||
@@ -109,6 +110,8 @@ struct bitmap_writer {
|
||||
struct bitmapped_commit *selected;
|
||||
unsigned int selected_nr, selected_alloc;
|
||||
|
||||
uint32_t pseudo_merges_nr;
|
||||
|
||||
struct progress *progress;
|
||||
int show_progress;
|
||||
unsigned char pack_checksum[GIT_MAX_RAWSZ];
|
||||
|
||||
Reference in New Issue
Block a user