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

[PATCH 2/3] Add a parameter to specify the repository path

From
DSDennis Stosberg <dennis@stosberg.net>
Date
Jun 21, 2006, 13:08 UTC
Message-ID
<20060621130802.G53392da4@leonov.stosberg.net>
In-Reply-To
<20060621130535.G2b34d382@leonov.stosberg.net>
---
 builtin-help.c |    2 +-
 git.c          |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/builtin-help.c b/builtin-help.c
index 7470faa..db233eb 100644
--- a/builtin-help.c
+++ b/builtin-help.c
@@ -10,7 +10,7 @@ #include "exec_cmd.h"
 #include "common-cmds.h"
 
 static const char git_usage[] =
-	"Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--help] COMMAND [ ARGS ]";
+	"Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--git-dir=GIT_DIR] [--help] COMMAND [ ARGS ]";
 
 /* most gui terms set COLUMNS (although some don't export it) */
 static int term_columns(void)
diff --git a/git.c b/git.c
index 94e9a4a..d49f626 100644
--- a/git.c
+++ b/git.c
@@ -277,6 +277,12 @@ int main(int argc, const char **argv, ch
 			puts(git_exec_path());
 			exit(0);
 		}
+
+		if (!strncmp(cmd, "git-dir=", 8)) {
+			setenv("GIT_DIR", cmd + 8, 1);
+			continue;
+		}
+
 		cmd_usage(0, NULL, NULL);
 	}
 	argv[0] = cmd;
-- 
1.4.0
Previous: Dennis StosbergNext: Dennis Stosberg
Message 14 of 35 in “[RFC] gitweb wishlist and TODO list”
  1. Jakub NarebskiJun 20, 2006
  2. Carl WorthJun 20, 2006
  3. Jakub NarebskiJun 20, 2006
  4. Petr BaudisJun 20, 2006
  5. Jakub NarebskiJun 20, 2006
  6. Petr BaudisJun 20, 2006
  7. Jakub NarebskiJun 21, 2006
  8. Martin LanghoffJun 20, 2006
  9. Jakub NarebskiJun 20, 2006
  10. Martin LanghoffJun 20, 2006
  11. Paul MackerrasJul 1, 2006
  12. Dennis StosbergJun 21, 2006
  13. 1/3 gitweb: Declare global variables with "our"Dennis Stosberg, Jun 21, 2006
  14. 2/3 Add a parameter to specify the repository pathDennis Stosberg, Jun 21, 2006
  15. 3/3 gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}Dennis Stosberg, Jun 21, 2006
  16. Timo HirvonenJun 21, 2006
  17. Jakub NarebskiJun 21, 2006
  18. Jakub NarebskiJun 21, 2006
  19. Dennis StosbergJun 22, 2006
  20. Ryan AndersonJun 22, 2006
  21. Ryan AndersonJun 21, 2006
  22. Jakub NarebskiJun 21, 2006
  23. Junio C HamanoJun 20, 2006
  24. Petr BaudisJun 20, 2006
  25. Jakub NarebskiJun 20, 2006
  26. Petr BaudisJun 20, 2006
  27. Thomas GlanzmannJun 20, 2006
  28. Josef WeidendorferJun 21, 2006
  29. Jakub NarebskiJun 21, 2006
  30. Josef WeidendorferJun 21, 2006
  31. Jakub NarebskiJun 21, 2006
  32. Jakub NarebskiJun 22, 2006
  33. Junio C HamanoJun 22, 2006
  34. Jakub NarebskiJun 21, 2006
  35. Josef WeidendorferJun 21, 2006

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.