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

[PATCH] setup: document prefix

From
Clemens Buchacher <drizzd@aon.at>
Date
Jun 5, 2010, 08:04 UTC
Message-ID
<20100605080420.GA1151@localhost>
In-Reply-To
<20100604075034.GB5117@localhost>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
On Fri, Jun 04, 2010 at 09:50:34AM +0200, Clemens Buchacher wrote:
>
> By the way, I noticed that we rely on the fact that a non-empty
> prefix ends with '/'. Is that ok?

I checked and the prefix does always end in a slash currently, but this guarantee is well hidden in the code. I would feel more at ease to continue relying on this with the comment below.

Regards, Clemens

 setup.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/setup.c b/setup.c
index 5716d90..0e4cfe6 100644
--- a/setup.c
+++ b/setup.c
@@ -519,6 +519,12 @@ int check_repository_format(void)
 	return check_repository_format_gently(NULL);
 }
 
+/*
+ * Returns the "prefix", a path to the current working directory
+ * relative to the work tree root, or NULL, if the current working
+ * directory is not a strict subdirectory of the work tree root. The
+ * prefix always ends with a '/' character.
+ */
 const char *setup_git_directory(void)
 {
 	const char *retval = setup_git_directory_gently(NULL);
-- 
1.7.1.2.ga1f6e
Previous: Clemens BuchacherNext: Clemens Buchacher
Message 14 of 23 in “What's cooking in git.git (Jun 2010, #01; Wed, 2)”
  1. Junio C HamanoJun 2, 2010
  2. Tay Ray ChuanJun 3, 2010
  3. 3/3 commit::print_summary(): set rev_info.always_show_header to 1Tay Ray Chuan, Jun 4, 2010
  4. Tay Ray ChuanJun 4, 2010
  5. Junio C HamanoJun 5, 2010
  6. commit::print_summary(): set rev_info.always_show_header to 1Tay Ray Chuan, Jun 7, 2010
  7. Michael J GruberJun 3, 2010
  8. mg/rev-parse-option-sifter-deprecationJonathan Nieder, Jun 3, 2010
  9. 1/2 separate quoting and relative path generationClemens Buchacher, Jun 3, 2010
  10. 2/2 ls-files: allow relative pathspecClemens Buchacher, Jun 3, 2010
  11. Junio C HamanoJun 3, 2010
  12. optimize path_relative()Clemens Buchacher, Jun 4, 2010
  13. Clemens BuchacherJun 4, 2010
  14. setup: document prefixClemens Buchacher, Jun 5, 2010
  15. optimize path_relative()Clemens Buchacher, Jun 5, 2010
  16. Junio C HamanoJun 5, 2010
  17. Thomas RastJun 3, 2010
  18. Eyvind BernhardsenJun 3, 2010
  19. Jonathan NiederJun 4, 2010
  20. Junio C HamanoJun 5, 2010
  21. Jonathan NiederJun 5, 2010
  22. Sverre RabbelierJun 5, 2010
  23. Junio C HamanoJun 6, 2010

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.