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

[PATCH] Implement --recover for git-*-fetch

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Sep 27, 2005, 01:38 UTC
Message-ID
<Pine.LNX.4.63.0509262137360.23242@iabervon.org>

With the --recover option, we verify that we have absolutely everything reachable from the target, not assuming that things reachable from refs will be complete.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 fetch.c       |    5 ++++-
 fetch.h       |    3 +++
 http-fetch.c  |    2 ++
 local-fetch.c |    2 ++
 ssh-fetch.c   |    2 ++
 5 files changed, 13 insertions(+), 1 deletions(-)
96e5339ec5759c716282465cb86e3e559270c51c
diff --git a/fetch.c b/fetch.c
--- a/fetch.c
+++ b/fetch.c
@@ -15,6 +15,7 @@ int get_tree = 0;
 int get_history = 0;
 int get_all = 0;
 int get_verbosely = 0;
+int get_recover = 0;
 static unsigned char current_commit_sha1[20];
 
 void pull_say(const char *fmt, const char *hex) 
@@ -214,7 +215,9 @@ int pull(char *target)
 			return -1;
 	}
 
-	for_each_ref(mark_complete);
+	if (!get_recover) {
+		for_each_ref(mark_complete);
+	}
 
 	if (interpret_target(target, sha1))
 		return error("Could not interpret %s as something to pull",
diff --git a/fetch.h b/fetch.h
--- a/fetch.h
+++ b/fetch.h
@@ -40,6 +40,9 @@ extern int get_all;
 /* Set to be verbose */
 extern int get_verbosely;
 
+/* Set to check on all reachable objects. */
+extern int get_recover;
+
 /* Report what we got under get_verbosely */
 extern void pull_say(const char *, const char *);
 
diff --git a/http-fetch.c b/http-fetch.c
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -491,6 +491,8 @@ int main(int argc, char **argv)
 		} else if (argv[arg][1] == 'w') {
 			write_ref = argv[arg + 1];
 			arg++;
+		} else if (!strcmp(argv[arg], "--recover")) {
+			get_recover = 1;
 		}
 		arg++;
 	}
diff --git a/local-fetch.c b/local-fetch.c
--- a/local-fetch.c
+++ b/local-fetch.c
@@ -231,6 +231,8 @@ int main(int argc, char **argv)
 			get_verbosely = 1;
 		else if (argv[arg][1] == 'w')
 			write_ref = argv[++arg];
+		else if (!strcmp(argv[arg], "--recover"))
+			get_recover = 1;
 		else
 			usage(local_pull_usage);
 		arg++;
diff --git a/ssh-fetch.c b/ssh-fetch.c
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
@@ -119,6 +119,8 @@ int main(int argc, char **argv)
 		} else if (argv[arg][1] == 'w') {
 			write_ref = argv[arg + 1];
 			arg++;
+		} else if (!strcmp(argv[arg], "--recover")) {
+			get_recover = 1;
 		}
 		arg++;
 	}
Message 1 of 1 in “Implement --recover for git-*-fetch”
  1. Implement --recover for git-*-fetchDaniel Barkalow, Sep 27, 2005

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.