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

[WIP PATCH 23/26] ls-remote: move up gitdir setup to run_builtin()

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 16, 2010, 16:05 UTC
Message-ID
<1266336317-607-24-git-send-email-pclouds@gmail.com>
In-Reply-To
<1266336317-607-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin-ls-remote.c |    3 ---
 git.c               |    4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c
index 70f5622..998f2c8 100644
--- a/builtin-ls-remote.c
+++ b/builtin-ls-remote.c
@@ -31,7 +31,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 {
 	int i;
 	const char *dest = NULL;
-	int nongit;
 	unsigned flags = 0;
 	const char *uploadpack = NULL;
 	const char **pattern = NULL;
@@ -40,8 +39,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 	struct transport *transport;
 	const struct ref *ref;
 
-	setup_git_directory_gently(&nongit);
-
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
 
diff --git a/git.c b/git.c
index c922400..8d23f75 100644
--- a/git.c
+++ b/git.c
@@ -351,7 +351,7 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "log", cmd_log, RUN_SETUP | USE_PAGER },
 		{ "ls-files", cmd_ls_files, RUN_SETUP },
 		{ "ls-tree", cmd_ls_tree, RUN_SETUP },
-		{ "ls-remote", cmd_ls_remote },
+		{ "ls-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
 		{ "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY },
 		{ "mailsplit", cmd_mailsplit },
 		{ "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
@@ -371,7 +371,7 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "pack-objects", cmd_pack_objects, RUN_SETUP },
 		{ "pack-redundant", cmd_pack_redundant, RUN_SETUP },
 		{ "patch-id", cmd_patch_id },
-		{ "peek-remote", cmd_ls_remote },
+		{ "peek-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
 		{ "pickaxe", cmd_blame, RUN_SETUP },
 		{ "prune", cmd_prune, RUN_SETUP },
 		{ "prune-packed", cmd_prune_packed, RUN_SETUP },
-- 
1.7.0.195.g637a2
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 24 of 27 in “Git setup cleanup series”
  1. 00/26 Git setup cleanup seriesNguyễn Thái Ngọc Duy, Feb 16, 2010
  2. 01/26 rev-parse --git-dir: print relative gitdir correctlyNguyễn Thái Ngọc Duy, Feb 16, 2010
  3. 02/26 setup_git_directory*: Explicitly set git dirNguyễn Thái Ngọc Duy, Feb 16, 2010
  4. 03/26 Save setup_git_dir* info globally for later useNguyễn Thái Ngọc Duy, Feb 16, 2010
  5. 04/26 Add GIT_HARDENED_SETUP to detect gitdir/worktree related mis-setup errorsNguyễn Thái Ngọc Duy, Feb 16, 2010
  6. 05/26 enter_repo(): use setup_git_directory_gently internallyNguyễn Thái Ngọc Duy, Feb 16, 2010
  7. 06/26 Tweak init/clone to work properly with GIT_HARDENED_SETUP=1Nguyễn Thái Ngọc Duy, Feb 16, 2010
  8. 07/26 Support running setup_git_dir_gently() from the beginning for builtin commandsNguyễn Thái Ngọc Duy, Feb 16, 2010
  9. 08/26 config: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  10. 09/26 hash-object: move gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  11. 10/26 shortlog: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  12. 11/26 Do not look for .git/info/exclude when gitdir is not set upNguyễn Thái Ngọc Duy, Feb 16, 2010
  13. 12/26 grep: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  14. 13/26 USE_PAGER should not be used without RUN_SETUP*Nguyễn Thái Ngọc Duy, Feb 16, 2010
  15. 14/26 Do not try to read $GIT_DIR/info/attributes if there is no repositoryNguyễn Thái Ngọc Duy, Feb 16, 2010
  16. 15/26 archive: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  17. 16/26 mailinfo: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  18. 17/26 check-ref-format: setup gitdir gentlyNguyễn Thái Ngọc Duy, Feb 16, 2010
  19. 18/26 verify-pack: set up gitdir gentlyNguyễn Thái Ngọc Duy, Feb 16, 2010
  20. 19/26 apply: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  21. 20/26 bundle: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  22. 21/26 diff: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  23. 22/26 help: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  24. 23/26 ls-remote: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  25. 24/26 var: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  26. 25/26 merge-file: move up gitdir setup to run_builtin()Nguyễn Thái Ngọc Duy, Feb 16, 2010
  27. 26/26 Turn on GIT_HARDENED_SETUP for the whole test suiteNguyễn Thái Ngọc Duy, Feb 16, 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.