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

[PATCH v3 1/2] clone: Fix error message for reference repository

From
Aaron Schrab <aaron@schrab.com>
Date
Apr 9, 2013, 22:21 UTC
Message-ID
<1365546120-22048-2-git-send-email-aaron@schrab.com>
In-Reply-To
<1365546120-22048-1-git-send-email-aaron@schrab.com>

Do not report that an argument to clone's --reference option is not a local directory. Nothing checks for the existence or type of the path as supplied by the user; checks are only done for particular contents of the supposed directory, so we have no way to know the status of the supplied path. Telling the user that a directory doesn't exist when that isn't actually known may lead him or her on the wrong path to finding the problem.

Instead just state that the entered path is not a local repository which is really all that is known about it. It could be more helpful to state the actual paths which were checked, but I believe that giving a good description of that would be too verbose for a simple error message and would be too dependent on implementation details.

Signed-off-by: Aaron Schrab <aaron@schrab.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
diff --git a/builtin/clone.c b/builtin/clone.c
index f9c380e..0a1e0bf 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -241,7 +241,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
 		free(ref_git);
 		ref_git = ref_git_git;
 	} else if (!is_directory(mkpath("%s/objects", ref_git)))
-		die(_("reference repository '%s' is not a local directory."),
+		die(_("reference repository '%s' is not a local repository."),
 		    item->string);
 
 	strbuf_addf(&alternate, "%s/objects", ref_git);
-- 
1.8.2.677.g9202ef0
Previous: Aaron SchrabNext: Aaron Schrab
Message 16 of 28 in “clone: Fix error message for reference repository”
  1. 1/2 clone: Fix error message for reference repositoryAaron Schrab, Apr 7, 2013
  2. 2/2 clone: Allow repo using gitfile as a referenceAaron Schrab, Apr 7, 2013
  3. Jonathan NiederApr 7, 2013
  4. Aaron SchrabApr 8, 2013
  5. Junio C HamanoApr 8, 2013
  6. Aaron SchrabApr 8, 2013
  7. 0/2 Using gitfile repository with clone --referenceAaron Schrab, Apr 8, 2013
  8. 1/2 clone: Fix error message for reference repositoryAaron Schrab, Apr 8, 2013
  9. Jonathan NiederApr 9, 2013
  10. 2/2 clone: Allow repo using gitfile as a referenceAaron Schrab, Apr 8, 2013
  11. Jonathan NiederApr 9, 2013
  12. Aaron SchrabApr 9, 2013
  13. Junio C HamanoApr 9, 2013
  14. Aaron SchrabApr 9, 2013
  15. 0/2 Using gitfile repository with clone --referenceAaron Schrab, Apr 9, 2013
  16. 1/2 clone: Fix error message for reference repositoryAaron Schrab, Apr 9, 2013
  17. 2/2 clone: Allow repo using gitfile as a referenceAaron Schrab, Apr 9, 2013
  18. Junio C HamanoApr 9, 2013
  19. Jonathan NiederApr 7, 2013
  20. Aaron SchrabApr 8, 2013
  21. Aaron SchrabApr 8, 2013
  22. Junio C HamanoApr 8, 2013
  23. Aaron SchrabApr 8, 2013
  24. Junio C HamanoApr 8, 2013
  25. Aaron SchrabApr 8, 2013
  26. Junio C HamanoApr 8, 2013
  27. Aaron SchrabApr 8, 2013
  28. Junio C HamanoApr 8, 2013

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.