Re: [PATCH v2 01/11] commit-graph: use MAX_NUM_CHUNKS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Garima Singh via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: Garima Singh <garima.singh@xxxxxxxxxxxxx>
> Subject: Re: [PATCH v2 01/11] commit-graph: use MAX_NUM_CHUNKS
>
> This is a minor cleanup to make it easier to change the
> number of chunks being written to the commit-graph in the future.

Looks good to me...

...with the very minor possible nitpick that the subject probably should
be

  [PATCH v2 01/11] commit-graph: define and use MAX_NUM_CHUNKS

But this is just a bikeshedding.  Feel free to disregard this.

Best,
-- 
Jakub Narębski

> Signed-off-by: Garima Singh <garima.singh@xxxxxxxxxxxxx>
> ---
>  commit-graph.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/commit-graph.c b/commit-graph.c
> index b205e65ed1..3c4d411326 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -23,6 +23,7 @@
>  #define GRAPH_CHUNKID_DATA 0x43444154 /* "CDAT" */
>  #define GRAPH_CHUNKID_EXTRAEDGES 0x45444745 /* "EDGE" */
>  #define GRAPH_CHUNKID_BASE 0x42415345 /* "BASE" */
> +#define MAX_NUM_CHUNKS 5
>  
>  #define GRAPH_DATA_WIDTH (the_hash_algo->rawsz + 16)
>  
> @@ -1356,8 +1357,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
>  	int fd;
>  	struct hashfile *f;
>  	struct lock_file lk = LOCK_INIT;
> -	uint32_t chunk_ids[6];
> -	uint64_t chunk_offsets[6];
> +	uint32_t chunk_ids[MAX_NUM_CHUNKS + 1];
> +	uint64_t chunk_offsets[MAX_NUM_CHUNKS + 1];
>  	const unsigned hashsz = the_hash_algo->rawsz;
>  	struct strbuf progress_title = STRBUF_INIT;
>  	int num_chunks = 3;




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux