Re: [PATCH] pack-objects: proper pack time stamping with --max-pack-size

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] pack-objects: proper pack time stamping with --max-pack-size

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:23

Nicolas Pitre [off-list ref] writes:
quoted hunk
Runtime pack access is done in the pack file mtime order since recent 
packs are more likely to contain frequently used objects than old packs.
However the --max-pack-size option can produce multiple packs with mtime 
in the reversed order as newer objects are always written first.

Let's modify mtime of later pack files (when any) so they appear older 
than preceding ones when a repack creates multiple packs.

Signed-off-by: Nicolas Pitre <redacted>
---
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index f504cff..4c2ed70 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -17,6 +17,8 @@
 #include "progress.h"
 #include "refs.h"
 
+#include <utime.h>
+
Hmmm.  Shouldn't this go to git-compat-util.h?

Re: [PATCH] pack-objects: proper pack time stamping with --max-pack-size

From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:44:23

On Thu, 13 Mar 2008, Junio C Hamano wrote:
Nicolas Pitre [off-list ref] writes:
quoted
Runtime pack access is done in the pack file mtime order since recent 
packs are more likely to contain frequently used objects than old packs.
However the --max-pack-size option can produce multiple packs with mtime 
in the reversed order as newer objects are always written first.

Let's modify mtime of later pack files (when any) so they appear older 
than preceding ones when a repack creates multiple packs.

Signed-off-by: Nicolas Pitre <redacted>
---
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index f504cff..4c2ed70 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -17,6 +17,8 @@
 #include "progress.h"
 #include "refs.h"
 
+#include <utime.h>
+
Hmmm.  Shouldn't this go to git-compat-util.h?
Maybe... if you say so.

The whole header file arrangement logic is somewhat escaping my mind, so 
I simply decided to do the same as in test-chmtime.c.


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