summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 48a7c1c)
raw | patch | inline | side by side (parent: 48a7c1c)
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | |
Wed, 24 Feb 2010 23:34:15 +0000 (00:34 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 25 Feb 2010 00:24:25 +0000 (16:24 -0800) |
This prints the list of repo-local environment variables.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-parse.txt | patch | blob | history | |
builtin-rev-parse.c | patch | blob | history |
index d677c72d5ea6a8d38cf77f663e6b5da591028efa..33092a33739feb59cb1c5912c7f3a221a88ff9ec 100644 (file)
--is-bare-repository::
When the repository is bare print "true", otherwise "false".
+--local-env-vars::
+ List the GIT_* environment variables that are local to the
+ repository (e.g. GIT_DIR or GIT_WORK_TREE, but not GIT_EDITOR).
+ Only the names of the variables are listed, not their value,
+ even if they are set.
+
--short::
--short=number::
Instead of outputting the full SHA1 values of object names try to
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index a8c5043dedd785b8fc43c0921edd01e2adac65e1..b76f205e62f29a21fc4b0fedb4a981488ec7cb7f 100644 (file)
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
if (argc > 1 && !strcmp("--sq-quote", argv[1]))
return cmd_sq_quote(argc - 2, argv + 2);
+ if (argc == 2 && !strcmp("--local-env-vars", argv[1])) {
+ int i;
+ for (i = 0; local_repo_env[i]; i++)
+ printf("%s\n", local_repo_env[i]);
+ return 0;
+ }
+
if (argc > 1 && !strcmp("-h", argv[1]))
usage(builtin_rev_parse_usage);