Re: [PATCH v2 06/23] pack-bitmap-write: support storing pseudo-merge commits
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 6, 2024, 11:52 UTC
- Message-ID
- <ZjjEmGHYnw20wVBg@tanuki>
- In-Reply-To
- <ee33a70324589a98c2239530b03cc2d7afbdfb9e.1714422410.git.me@ttaylorr.com>
On Mon, Apr 29, 2024 at 04:43:15PM -0400, Taylor Blau wrote: [snip]
Show 8 quoted lines
> @@ -46,6 +48,11 @@ struct bitmap_writer {
>
> static struct bitmap_writer writer;
>
> +static inline int bitmap_writer_selected_nr(void)
> +{
> + return writer.selected_nr - writer.pseudo_merges_nr;
> +}This function may use a comment to explain what its meaning actually is. Like, `bitmap_writer_selected_nr()` is obviously not the same as the `selected_nr` of the `bitmap_writer`, which is quite confusing. So why do we subtract values and why are there two different `selected_nr`s?
[snip]
Show 10 quoted lines
> diff --git a/pack-bitmap.h b/pack-bitmap.h
> index dae2d68a338..ca9acd2f735 100644
> --- a/pack-bitmap.h
> +++ b/pack-bitmap.h
> @@ -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)This flag is already used by "builtin/pack-objects.c", which may be fine. But in any case, shouldn't we update "object.h" with both of these flags?
Patrick