Re: [GSoC PATCH v4 2/5] pack-write: add helper to fill promisor file after repack

2 messages, 2 authors, 2026-04-10 · open the first message on its own page

Re: [GSoC PATCH v4 2/5] pack-write: add helper to fill promisor file after repack

From: Junio C Hamano <hidden>
Date: 2026-04-10 16:01:19

LorenzoPegorari [off-list ref] writes:
quoted hunk
+			/* If <time> doesn't exist, retrieve it and add it to line */
+			if (line_sections.nr < 3)
+				strbuf_addf(&line, " %lld", (long long int)source_stat.st_mtim.tv_sec);
It should be easy to see in the output of

	$ git grep -e '%lld' -e 'st_mtim\.tv_sec'

that we do not use these constructs.

Write it like this instead

				strbuf_addf(&line, " %" PRItime,
					    (timestamp_t)source_stat.st_mtime);

examples to mimick the uses of timestamp_t and PRItime are found in
many places; worktree.c, date.c, builtin/blame.c would give plenty.

Re: [GSoC PATCH v4 2/5] pack-write: add helper to fill promisor file after repack

From: Lorenzo Pegorari <hidden>
Date: 2026-04-10 16:34:53

On Fri, Apr 10, 2026 at 09:01:16AM -0700, Junio C Hamano wrote:
LorenzoPegorari [off-list ref] writes:
quoted
+			/* If <time> doesn't exist, retrieve it and add it to line */
+			if (line_sections.nr < 3)
+				strbuf_addf(&line, " %lld", (long long int)source_stat.st_mtim.tv_sec);
It should be easy to see in the output of

	$ git grep -e '%lld' -e 'st_mtim\.tv_sec'

that we do not use these constructs.

Write it like this instead

				strbuf_addf(&line, " %" PRItime,
					    (timestamp_t)source_stat.st_mtime);

examples to mimick the uses of timestamp_t and PRItime are found in
many places; worktree.c, date.c, builtin/blame.c would give plenty.
Oh I see. I really need to get into this mechanism of constantly using
`git grep` to look for examples for pretty much everything. Still
learning. Thanks Junio!

Lorenzo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help