{"thread":{"id":"3959","subject":"[PATCH 1/4] git-repo-config --list support","startedAt":"2006-04-24T22:59:25Z","lastAt":"2006-04-25T08:39:18Z","messageCount":5,"participants":["Petr Baudis","Uwe Zeisberger"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"19062","messageId":"20060424225925.14086.97825.stgit@machine.or.cz","threadId":"3959","inReplyTo":null,"subject":"[PATCH 1/4] git-repo-config --list support","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-04-24T22:59:25Z","receivedAt":"2006-04-24T22:59:25Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This adds git-repo-config --list (or git-repo-config -l) support,\nsimilar to what git-var -l does now (to be phased out so that we\nhave a single sane interface to the config file instead of fragmented\nand confused API).\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-repo-config.txt |    4 ++++\n repo-config.c                     |   16 ++++++++++++++--\n 2 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt\nindex 26759a8..c08ab77 100644\n--- a/Documentation/git-repo-config.txt\n+++ b/Documentation/git-repo-config.txt\n@@ -15,6 +15,7 @@ SYNOPSIS\n 'git-repo-config' [type] --get-all name [value_regex]\n 'git-repo-config' [type] --unset name [value_regex]\n 'git-repo-config' [type] --unset-all name [value_regex]\n+'git-repo-config' -l | --list\n \n DESCRIPTION\n -----------\n@@ -64,6 +65,9 @@ OPTIONS\n --unset-all::\n \tRemove all matching lines from .git/config.\n \n+-l, --list::\n+\tList all variables set in .git/config.\n+\n \n EXAMPLE\n -------\ndiff --git a/repo-config.c b/repo-config.c\nindex c5ebb76..fa8aba7 100644\n--- a/repo-config.c\n+++ b/repo-config.c\n@@ -2,7 +2,7 @@ #include \"cache.h\"\n #include <regex.h>\n \n static const char git_config_set_usage[] =\n-\"git-repo-config [ --bool | --int ] [--get | --get-all | --replace-all | --unset | --unset-all] name [value [value_regex]]\";\n+\"git-repo-config [ --bool | --int ] [--get | --get-all | --replace-all | --unset | --unset-all] name [value [value_regex]] | --list\";\n \n static char* key = NULL;\n static char* value = NULL;\n@@ -12,6 +12,15 @@ static int do_not_match = 0;\n static int seen = 0;\n static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;\n \n+static int show_all_config(const char *key_, const char *value_)\n+{\n+\tif (value_)\n+\t\tprintf(\"%s=%s\\n\", key_, value_);\n+\telse\n+\t\tprintf(\"%s\\n\", key_);\n+\treturn 0;\n+}\n+\n static int show_config(const char* key_, const char* value_)\n {\n \tif (value_ == NULL)\n@@ -67,7 +76,7 @@ static int get_value(const char* key_, c\n \t\t}\n \t}\n \n-\ti = git_config(show_config);\n+\tgit_config(show_config);\n \tif (value) {\n \t\tprintf(\"%s\\n\", value);\n \t\tfree(value);\n@@ -99,6 +108,9 @@ int main(int argc, const char **argv)\n \t\targv++;\n \t}\n \n+\tif (!strcmp(argv[1], \"--list\") || !strcmp(argv[1], \"-l\"))\n+\t\treturn git_config(show_all_config);\n+\n \tswitch (argc) {\n \tcase 2:\n \t\treturn get_value(argv[1], NULL);\n"},{"id":"19063","messageId":"20060424225928.14086.54461.stgit@machine.or.cz","threadId":"3959","inReplyTo":"20060424225925.14086.97825.stgit@machine.or.cz","subject":"[PATCH 2/4] Document git-var -l listing also configuration variables","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-04-24T22:59:28Z","receivedAt":"2006-04-24T22:59:28Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Signed-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-var.txt |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-var.txt b/Documentation/git-var.txt\nindex 90cb157..379571e 100644\n--- a/Documentation/git-var.txt\n+++ b/Documentation/git-var.txt\n@@ -17,7 +17,9 @@ Prints a git logical variable.\n OPTIONS\n -------\n -l::\n-\tCause the logical variables to be listed.\n+\tCause the logical variables to be listed. In addition, all the\n+\tvariables of the git configuration file .git/config are listed\n+\tas well.\n \n EXAMPLE\n --------\n@@ -46,6 +48,7 @@ See Also\n --------\n gitlink:git-commit-tree[1]\n gitlink:git-tag[1]\n+gitlink:git-repo-config[1]\n \n Author\n ------\n"},{"id":"19064","messageId":"20060424225930.14086.76174.stgit@machine.or.cz","threadId":"3959","inReplyTo":"20060424225925.14086.97825.stgit@machine.or.cz","subject":"[PATCH 3/4] Deprecate usage of git-var -l for getting config vars list","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-04-24T22:59:30Z","receivedAt":"2006-04-24T22:59:30Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This has been an unfortunate sideway in the git API evolution.\nWe use git-repo-config for all the other .git/config interaction\nso let's also use git-repo-config -l for the variable listing.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/git-var.txt |    3 ++-\n git-cvsserver.perl        |    6 +++---\n 2 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-var.txt b/Documentation/git-var.txt\nindex 379571e..a5b1a0d 100644\n--- a/Documentation/git-var.txt\n+++ b/Documentation/git-var.txt\n@@ -19,7 +19,8 @@ OPTIONS\n -l::\n \tCause the logical variables to be listed. In addition, all the\n \tvariables of the git configuration file .git/config are listed\n-\tas well.\n+\tas well. (However, the configuration variables listing functionality\n+\tis deprecated in favor of `git-repo-config -l`.)\n \n EXAMPLE\n --------\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 7d3f78e..0b37d26 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -171,11 +171,11 @@ sub req_Root\n        return 0;\n     }\n \n-    my @gitvars = `git-var -l`;\n+    my @gitvars = `git-repo-config -l`;\n     if ($?) {\n-       print \"E problems executing git-var on the server -- this is not a git repository or the PATH is not set correcly.\\n\";\n+       print \"E problems executing git-repo-config on the server -- this is not a git repository or the PATH is not set correcly.\\n\";\n         print \"E \\n\";\n-        print \"error 1 - problem executing git-var\\n\";\n+        print \"error 1 - problem executing git-repo-config\\n\";\n        return 0;\n     }\n     foreach my $line ( @gitvars )\n"},{"id":"19065","messageId":"20060424225933.14086.42932.stgit@machine.or.cz","threadId":"3959","inReplyTo":"20060424225925.14086.97825.stgit@machine.or.cz","subject":"[PATCH 4/4] Document the configuration file","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-04-24T22:59:33Z","receivedAt":"2006-04-24T22:59:33Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"This patch adds a Documentation/config.txt file included by git-repo-config\nand currently aggregating hopefully all the available git plumbing / core\nporcelain configuration variables, as well as briefly describing the format.\n\nIt also updates an outdated bit of the example in git-repo-config(1).\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n Documentation/config.txt          |  181 +++++++++++++++++++++++++++++++++++++\n Documentation/git-repo-config.txt |   29 +++---\n config.c                          |    2 \n 3 files changed, 198 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nnew file mode 100644\nindex 0000000..6cd9670\n--- /dev/null\n+++ b/Documentation/config.txt\n@@ -0,0 +1,181 @@\n+CONFIGURATION FILE\n+------------------\n+\n+The git configuration file contains a number of variables that affect\n+the git commands behaviour. They can be used by both the git plumbing\n+and the porcelains. The variables are divided to sections, where\n+in the fully qualified variable name the variable itself is the last\n+dot-separated segment and the section name is everything before the last\n+dot. The variable names are case-insensitive and only alphanumeric\n+characters are allowed. Some variables may appear multiple times.\n+\n+The syntax is fairly flexible and permissive; whitespaces are mostly\n+ignored. The '#' and ';' characters begin commends to the end of line,\n+blank lines are ignored, lines containing strings enclosed in square\n+brackets start sections and all the other lines are recognized\n+as setting variables, in the form 'name = value'. If there is no equal\n+sign on the line, the entire line is taken as 'name' and the variable\n+is recognized as boolean \"true\". String values may be entirely or partially\n+enclosed in double quotes; some variables may require special value format.\n+\n+Example\n+~~~~~~~\n+\n+\t# Core variables\n+\t[core]\n+\t\t; Don't trust file modes\n+\t\tfilemode = false\n+\t\n+\t# Our diff algorithm\n+\t[diff]\n+\t\texternal = \"/usr/local/bin/gnu-diff -u\"\n+\t\trenames = true\n+\n+Variables\n+~~~~~~~~~\n+\n+Note that this list is non-comprehensive and not necessarily complete.\n+For command-specific variables, you will find more detailed description\n+in the appropriate manual page. You will find description of non-core\n+porcelain configuration variables in the respective porcelain documentation.\n+\n+core.fileMode::\n+\tIf false, the executable bit differences between the index and\n+\tthe working copy are ignored; useful on broken filesystems like FAT.\n+\tSee gitlink:git-update-index[1]. True by default.\n+\n+core.gitProxy::\n+\tA \"proxy command\" to execute (as 'command host port') instead\n+\tof establishing direct connection to the remote server when\n+\tusing the git protocol for fetching. If the variable value is\n+\tin the \"COMMAND for DOMAIN\" format, the command is applied only\n+\ton hostnames ending with the specified domain string. This variable\n+\tmay be set multiple times and is matched in the given order;\n+\tthe first match wins.\n+\n+\tCan be overriden by the 'GIT_PROXY_COMMAND' environment variable\n+\t(which always applies universally, without the special \"for\"\n+\thandling).\n+\n+core.ignoreStat::\n+\tThe working copy files are assumed to stay unchanged until you\n+\tmark them otherwise manually - Git will not detect the file changes\n+\tby lstat() calls. This is useful on systems where those are very\n+\tslow, such as Microsoft Windows.  See gitlink:git-update-index[1].\n+\tFalse by default.\n+\n+core.onlyUseSymrefs::\n+\tAlways use the \"symref\" format instead of symbolic links for HEAD\n+\tand other symbolic reference files. True by default.\n+\n+core.repositoryFormatVersion::\n+\tInternal variable identifying the repository format and layout\n+\tversion.\n+\n+core.sharedRepository::\n+\tIf true, the repository is made shareable between several users\n+\tin a group (making sure all the files and objects are group-writable).\n+\tSee gitlink:git-init-db[1]. False by default.\n+\n+core.warnAmbiguousRefs::\n+\tIf true, git will warn you if the ref name you passed it is ambiguous\n+\tand might match multiple refs in the .git/refs/ tree. True by default.\n+\n+apply.whitespace::\n+\tTells `git-apply` how to handle whitespaces, in the same way\n+\tas the '--whitespace' option. See gitlink:git-apply[1].\n+\n+diff.renameLimit::\n+\tThe number of files to consider when performing the copy/rename\n+\tdetection; equivalent to the git diff option '-l'.\n+\n+format.headers::\n+\tAdditional email headers to include in a patch to be submitted\n+\tby mail.  See gitlink:git-format-patch[1].\n+\n+gitcvs.enabled::\n+\tWhether the cvs pserver interface is enabled for this repository.\n+\tSee gitlink:git-cvsserver[1].\n+\n+gitcvs.logfile::\n+\tPath to a log file where the cvs pserver interface well... logs\n+\tvarious stuff. See gitlink:git-cvsserver[1].\n+\n+http.sslVerify::\n+\tWhether to verify the SSL certificate when fetching or pushing\n+\tover HTTPS. Can be overriden by the 'GIT_SSL_NO_VERIFY' environment\n+\tvariable.\n+\n+http.sslCert::\n+\tFile containing the SSL certificate when fetching or pushing\n+\tover HTTPS. Can be overriden by the 'GIT_SSL_CERT' environment\n+\tvariable.\n+\n+http.sslKey::\n+\tFile containing the SSL private key when fetching or pushing\n+\tover HTTPS. Can be overriden by the 'GIT_SSL_KEY' environment\n+\tvariable.\n+\n+http.sslCAInfo::\n+\tFile containing the certificates to verify the peer with when\n+\tfetching or pushing over HTTPS. Can be overriden by the\n+\t'GIT_SSL_CAINFO' environment variable.\n+\n+http.sslCAPath::\n+\tPath containing files with the CA certificates to verify the peer\n+\twith when fetching or pushing over HTTPS. Can be overriden\n+\tby the 'GIT_SSL_CAPATH' environment variable.\n+\n+http.maxRequests::\n+\tHow many HTTP requests to launch in parallel. Can be overriden\n+\tby the 'GIT_HTTP_MAX_REQUESTS' environment variable. Default is 5.\n+\n+http.lowSpeedLimit, http.lowSpeedTime::\n+\tIf the HTTP transfer speed is less than 'http.lowSpeedLimit'\n+\tfor longer than 'http.lowSpeedTime' seconds, the transfer is aborted.\n+\tCan be overriden by the 'GIT_HTTP_LOW_SPEED_LIMIT' and\n+\t'GIT_HTTP_LOW_SPEED_TIME' environment variables.\n+\n+i18n.commitEncoding::\n+\tCharacter encoding the commit messages are stored in; git itself\n+\tdoes not care per se, but this information is necessary e.g. when\n+\timporting commits from emails or in the gitk graphical history\n+\tbrowser (and possibly at other places in the future or in other\n+\tporcelains). See e.g. gitlink:git-mailinfo[1]. Defaults to 'utf-8'.\n+\n+merge.summary::\n+\tWhether to include summaries of merged commits in newly created\n+\tmerge commit messages. False by default.\n+\n+pull.octopus::\n+\tThe default merge strategy to use when pulling multiple branches\n+\tat once.\n+\n+pull.twohead::\n+\tThe default merge strategy to use when pulling a single branch.\n+\n+show.difftree::\n+\tThe default gitlink:git-diff-tree[1] arguments to be used\n+\tfor gitlink:git-show[1].\n+\n+showbranch.default::\n+\tThe default set of branches for gitlink:git-show-branch[1].\n+\tSee gitlink:git-show-branch[1].\n+\n+user.email::\n+\tYour email address to be recorded in any newly created commits.\n+\tCan be overriden by the 'GIT_AUTHOR_EMAIL' and 'GIT_COMMITTER_EMAIL'\n+\tenvironment variables.  See gitlink:git-commit-tree[1].\n+\n+user.name::\n+\tYour full name to be recorded in any newly created commits.\n+\tCan be overriden by the 'GIT_AUTHOR_NAME' and 'GIT_COMMITTER_NAME'\n+\tenvironment variables.  See gitlink:git-commit-tree[1].\n+\n+whatchanged.difftree::\n+\tThe default gitlink:git-diff-tree[1] arguments to be used\n+\tfor gitlink:git-whatchanged[1].\n+\n+imap::\n+\tThe configuration variables in the 'imap' section are described\n+\tin gitlink:git-imap-send[1].\ndiff --git a/Documentation/git-repo-config.txt b/Documentation/git-repo-config.txt\nindex c08ab77..566cfa1 100644\n--- a/Documentation/git-repo-config.txt\n+++ b/Documentation/git-repo-config.txt\n@@ -91,11 +91,11 @@ Given a .git/config like this:\n \t\trenames = true\n \n \t; Proxy settings\n-\t[proxy]\n-\t\tcommand=\"ssh\" for \"ssh://kernel.org/\"\n-\t\tcommand=\"proxy-command\" for kernel.org\n-\t\tcommand=\"myprotocol-command\" for \"my://\"\n-\t\tcommand=default-proxy ; for all the rest\n+\t[core]\n+\t\tgitproxy=\"ssh\" for \"ssh://kernel.org/\"\n+\t\tgitproxy=\"proxy-command\" for kernel.org\n+\t\tgitproxy=\"myprotocol-command\" for \"my://\"\n+\t\tgitproxy=default-proxy ; for all the rest\n \n you can set the filemode to true with\n \n@@ -108,7 +108,7 @@ to what URL they apply. Here is how to c\n to \"ssh\".\n \n ------------\n-% git repo-config proxy.command '\"ssh\" for kernel.org' 'for kernel.org$'\n+% git repo-config core.gitproxy '\"ssh\" for kernel.org' 'for kernel.org$'\n ------------\n \n This makes sure that only the key/value pair for kernel.org is replaced.\n@@ -119,7 +119,7 @@ To delete the entry for renames, do\n % git repo-config --unset diff.renames\n ------------\n \n-If you want to delete an entry for a multivar (like proxy.command above),\n+If you want to delete an entry for a multivar (like core.gitproxy above),\n you have to provide a regex matching the value of exactly one line.\n \n To query the value for a given key, do\n@@ -137,27 +137,27 @@ or\n or, to query a multivar:\n \n ------------\n-% git repo-config --get proxy.command \"for kernel.org$\"\n+% git repo-config --get core.gitproxy \"for kernel.org$\"\n ------------\n \n If you want to know all the values for a multivar, do:\n \n ------------\n-% git repo-config --get-all proxy.command\n+% git repo-config --get-all core.gitproxy\n ------------\n \n-If you like to live dangerous, you can replace *all* proxy.commands by a\n+If you like to live dangerous, you can replace *all* core.gitproxy by a\n new one with\n \n ------------\n-% git repo-config --replace-all proxy.command ssh\n+% git repo-config --replace-all core.gitproxy ssh\n ------------\n \n However, if you really only want to replace the line for the default proxy,\n i.e. the one without a \"for ...\" postfix, do something like this:\n \n ------------\n-% git repo-config proxy.command ssh '! for '\n+% git repo-config core.gitproxy ssh '! for '\n ------------\n \n To actually match only values with an exclamation mark, you have to\n@@ -167,13 +167,16 @@ To actually match only values with an ex\n ------------\n \n \n+include::config.txt[]\n+\n+\n Author\n ------\n Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>\n \n Documentation\n --------------\n-Documentation by Johannes Schindelin.\n+Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.kernel.org>.\n \n GIT\n ---\ndiff --git a/config.c b/config.c\nindex 7ea8a73..4e1f0c2 100644\n--- a/config.c\n+++ b/config.c\n@@ -252,7 +252,7 @@ int git_default_config(const char *var, \n \t\treturn 0;\n \t}\n \n-\t/* Add other config variables here.. */\n+\t/* Add other config variables here and to Documentation/config.txt. */\n \treturn 0;\n }\n \n"},{"id":"19087","messageId":"20060425083918.GB1663@informatik.uni-freiburg.de","threadId":"3959","inReplyTo":"20060424225930.14086.76174.stgit@machine.or.cz","subject":"Re: [PATCH 3/4] Deprecate usage of git-var -l for getting config vars list","fromName":"Uwe Zeisberger","fromEmail":"zeisberg@informatik.uni-freiburg.de","sentAt":"2006-04-25T08:39:18Z","receivedAt":"2006-04-25T08:39:18Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello Petr,\n\nPetr Baudis wrote:\n> +    my @gitvars = `git-repo-config -l`;\n>      if ($?) {\n> -       print \"E problems executing git-var on the server -- this is not a git repository or the PATH is not set correcly.\\n\";\n> +       print \"E problems executing git-repo-config on the server -- this is not a git repository or the PATH is not set correcly.\\n\";\n\nI didn't check the patch, but you may want to s/correcly/correctly/.\n\nBest regards\nUwe\n\n-- \nUwe Zeisberger\n\nhttp://www.google.com/search?q=5+choose+3\n"}]}