[GSoC PATCH 1/3] pack-write: add explanation to promisor file content
- From
LorenzoPegorari <lorenzo.pegorari2002@gmail.com>
- Date
- Mar 21, 2026, 21:28 UTC
- Message-ID
- <9bba49563e809634e223c3b9d75496cde94707db.1774125871.git.lorenzo.pegorari2002@gmail.com>
- In-Reply-To
- <cover.1774125871.git.lorenzo.pegorari2002@gmail.com>
In the entire codebase there is no explanation as to why the ".promisor" files may contain the ref names (and their associated hashes) that were fetched at the time the corresponding packfile was downloaded.
Add comment explaining that these pieces of information are used only for debugging reasons, and how they can be used while debugging.
Signed-off-by: LorenzoPegorari <lorenzo.pegorari2002@gmail.com> --- pack-write.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/pack-write.c b/pack-write.c index 83eaf88541..6a2023327e 100644 --- a/pack-write.c +++ b/pack-write.c @@ -603,6 +603,15 @@ void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_ int i, err; FILE *output = xfopen(promisor_name, "w"); + /* + * Write in the .promisor file the ref names and associated hashes, + * obtained by fetch-pack, at the point of generation of the + * corresponding packfile. These pieces of info are only used to make + * it easier to debug issues with partial clones, as we can identify + * what refs (and their associated hashes) were fetched at the time + * the packfile was downloaded, and if necessary, compare those hashes + * against what the promisor remote reports now. + */ for (i = 0; i < nr_sought; i++) fprintf(output, "%s %s\n", oid_to_hex(&sought[i]->old_oid), sought[i]->name);
-- 2.43.0