git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] downgrade "packfile cannot be accessed" errors to warnings

From
Jeff King <peff@peff.net>
Date
Oct 14, 2011, 18:04 UTC
Message-ID
<20111014180415.GB17412@sigill.intra.peff.net>
In-Reply-To
<20111014012320.GA4395@sigill.intra.peff.net>

These can happen if another process simultaneously prunes a pack. But that is not usually an error condition, because a properly-running prune should have repacked the object into a new pack. So we will notice that the pack has disappeared unexpectedly, print a message, try other packs (possibly after re-scanning the list of packs), and find it in the new pack.

Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Jeff King <peff@peff.net>
---
Repost with ack from Nicolas, and more obvious subject line. No changes
from earlier version in this thread.
 builtin/pack-objects.c |    2 +-
 sha1_file.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 8681ccd..ba3705d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -805,7 +805,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
 		if (offset) {
 			if (!found_pack) {
 				if (!is_pack_valid(p)) {
-					error("packfile %s cannot be accessed", p->pack_name);
+					warning("packfile %s cannot be accessed", p->pack_name);
 					continue;
 				}
 				found_offset = offset;
diff --git a/sha1_file.c b/sha1_file.c
index a22c5b4..27f3b9b 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2038,7 +2038,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
 			 * was loaded!
 			 */
 			if (!is_pack_valid(p)) {
-				error("packfile %s cannot be accessed", p->pack_name);
+				warning("packfile %s cannot be accessed", p->pack_name);
 				goto next;
 			}
 			e->offset = offset;
-- 
1.7.6.4.37.g43b58b
Previous: Jeff King
Message 10 of 10 in “pack-objects: protect against disappearing packs”
  1. pack-objects: protect against disappearing packsJeff King, Oct 14, 2011
  2. Jeff KingOct 14, 2011
  3. Nicolas PitreOct 14, 2011
  4. Nicolas PitreOct 14, 2011
  5. Jeff KingOct 14, 2011
  6. Johannes SixtOct 14, 2011
  7. Jeff KingOct 14, 2011
  8. Johannes SixtOct 14, 2011
  9. 1/2 pack-objects: protect against disappearing packsJeff King, Oct 14, 2011
  10. 2/2 downgrade "packfile cannot be accessed" errors to warningsJeff King, Oct 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.