summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 829a686)
raw | patch | inline | side by side (parent: 829a686)
author | Tom Prince <tom.prince@ualberta.net> | |
Mon, 29 Jan 2007 00:16:53 +0000 (16:16 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 29 Jan 2007 00:16:53 +0000 (16:16 -0800) |
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
59 files changed:
diff --git a/.gitignore b/.gitignore
index 6da1cdbd0de72dc1bff64414e901484474d22a36..b4dccd7b816e958273ec84b77e8ff4d1602461de 100644 (file)
--- a/.gitignore
+++ b/.gitignore
git-clone
git-commit
git-commit-tree
+git-config
git-convert-objects
git-count-objects
git-cvsexportcommit
index 744db82413fbd31f4dd906c2a46702a20953b6c5..824462551f4663fcce2d97b0dccbcba0851a5bdf 100755 (executable)
git-reflog ancillarymanipulators
git-relink ancillarymanipulators
git-repack ancillarymanipulators
-git-repo-config ancillarymanipulators
+git-config ancillarymanipulators
git-request-pull foreignscminterface
git-rerere ancillaryinterrogators
git-reset mainporcelain
index ebda2e0f6117d8306e671601513275f25af8fce6..e5e019fedd8a774877162c9e4bb5e001564e7d47 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
a string, an integer, or a boolean. Boolean values may be given as yes/no,
0/1 or true/false. Case is not significant in boolean values, when
converting value to the canonical form using '--bool' type specifier;
-`git-repo-config` will ensure that the output is "true" or "false".
+`git-config` will ensure that the output is "true" or "false".
String values may be entirely or partially enclosed in double quotes.
You need to enclose variable value in double quotes if you want to
index 7317489cfcdda369e7e296ff9032c36848efe11e..86a9c7521aeeb59d05aab1d2fc9d664950087422 100644 (file)
like this:
------------------------------------------------
-$ git repo-config remote.linus.url http://www.kernel.org/pub/scm/git/git.git/
+$ git config remote.linus.url http://www.kernel.org/pub/scm/git/git.git/
------------------------------------------------
and use the "linus" keyword with `git pull` instead of the full URL.
index 775bf4266a769e3ad2ca6eb14333b2c569b98698..764cc560b4aeeb7248d94f939c976634bd395823 100644 (file)
================================
The `pull` command knows where to get updates from because of certain
configuration variables that were set by the first `git clone`
-command; see `git repo-config -l` and the gitlink:git-repo-config[1] man
+command; see `git config -l` and the gitlink:git-config[1] man
page for details.
================================
index ca36a76da6a28d89d5cc0cba76517de88489048a..fbbbc92b811f32581e20f96c3c664368ce4e801b 100644 (file)
------------
satellite$ git clone mothership:frotz frotz <1>
satellite$ cd frotz
-satellite$ git repo-config --get-regexp '^(remote|branch)\.' <2>
+satellite$ git config --get-regexp '^(remote|branch)\.' <2>
remote.origin.url mothership:frotz
remote.origin.fetch refs/heads/*:refs/remotes/origin/*
branch.master.remote origin
branch.master.merge refs/heads/master
-satellite$ git repo-config remote.origin.push \
+satellite$ git config remote.origin.push \
master:refs/remotes/satellite/master <3>
satellite$ edit/compile/test/commit
satellite$ git push origin <4>
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
--- /dev/null
@@ -0,0 +1,227 @@
+git-config(1)
+=============
+
+NAME
+----
+git-config - Get and set repository or global options
+
+
+SYNOPSIS
+--------
+[verse]
+'git-config' [--global] [type] name [value [value_regex]]
+'git-config' [--global] [type] --add name value
+'git-config' [--global] [type] --replace-all name [value [value_regex]]
+'git-config' [--global] [type] --get name [value_regex]
+'git-config' [--global] [type] --get-all name [value_regex]
+'git-config' [--global] [type] --unset name [value_regex]
+'git-config' [--global] [type] --unset-all name [value_regex]
+'git-config' [--global] -l | --list
+
+DESCRIPTION
+-----------
+You can query/set/replace/unset options with this command. The name is
+actually the section and the key separated by a dot, and the value will be
+escaped.
+
+Multiple lines can be added to an option by using the '--add' option.
+If you want to update or unset an option which can occur on multiple
+lines, a POSIX regexp `value_regex` needs to be given. Only the
+existing values that match the regexp are updated or unset. If
+you want to handle the lines that do *not* match the regex, just
+prepend a single exclamation mark in front (see EXAMPLES).
+
+The type specifier can be either '--int' or '--bool', which will make
+'git-config' ensure that the variable(s) are of the given type and
+convert the value to the canonical form (simple decimal number for int,
+a "true" or "false" string for bool). If no type specifier is passed,
+no checks or transformations are performed on the value.
+
+This command will fail if:
+
+. The .git/config file is invalid,
+. Can not write to .git/config,
+. no section was provided,
+. the section or key is invalid,
+. you try to unset an option which does not exist,
+. you try to unset/set an option for which multiple lines match, or
+. you use --global option without $HOME being properly set.
+
+
+OPTIONS
+-------
+
+--replace-all::
+ Default behavior is to replace at most one line. This replaces
+ all lines matching the key (and optionally the value_regex).
+
+--add::
+ Adds a new line to the option without altering any existing
+ values. This is the same as providing '^$' as the value_regex.
+
+--get::
+ Get the value for a given key (optionally filtered by a regex
+ matching the value). Returns error code 1 if the key was not
+ found and error code 2 if multiple key values were found.
+
+--get-all::
+ Like get, but does not fail if the number of values for the key
+ is not exactly one.
+
+--get-regexp::
+ Like --get-all, but interprets the name as a regular expression.
+
+--global::
+ Use global ~/.gitconfig file rather than the repository .git/config.
+
+--unset::
+ Remove the line matching the key from config file.
+
+--unset-all::
+ Remove all matching lines from config file.
+
+-l, --list::
+ List all variables set in config file.
+
+--bool::
+ git-config will ensure that the output is "true" or "false"
+
+--int::
+ git-config will ensure that the output is a simple
+ decimal number. An optional value suffix of 'k', 'm', or 'g'
+ in the config file will cause the value to be multiplied
+ by 1024, 1048576, or 1073741824 prior to output.
+
+
+ENVIRONMENT
+-----------
+
+GIT_CONFIG::
+ Take the configuration from the given file instead of .git/config.
+ Using the "--global" option forces this to ~/.gitconfig.
+
+GIT_CONFIG_LOCAL::
+ Currently the same as $GIT_CONFIG; when Git will support global
+ configuration files, this will cause it to take the configuration
+ from the global configuration file in addition to the given file.
+
+
+EXAMPLE
+-------
+
+Given a .git/config like this:
+
+ #
+ # This is the config file, and
+ # a '#' or ';' character indicates
+ # a comment
+ #
+
+ ; core variables
+ [core]
+ ; Don't trust file modes
+ filemode = false
+
+ ; Our diff algorithm
+ [diff]
+ external = "/usr/local/bin/gnu-diff -u"
+ renames = true
+
+ ; Proxy settings
+ [core]
+ gitproxy="ssh" for "ssh://kernel.org/"
+ gitproxy="proxy-command" for kernel.org
+ gitproxy="myprotocol-command" for "my://"
+ gitproxy=default-proxy ; for all the rest
+
+you can set the filemode to true with
+
+------------
+% git config core.filemode true
+------------
+
+The hypothetical proxy command entries actually have a postfix to discern
+what URL they apply to. Here is how to change the entry for kernel.org
+to "ssh".
+
+------------
+% git config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'
+------------
+
+This makes sure that only the key/value pair for kernel.org is replaced.
+
+To delete the entry for renames, do
+
+------------
+% git config --unset diff.renames
+------------
+
+If you want to delete an entry for a multivar (like core.gitproxy above),
+you have to provide a regex matching the value of exactly one line.
+
+To query the value for a given key, do
+
+------------
+% git config --get core.filemode
+------------
+
+or
+
+------------
+% git config core.filemode
+------------
+
+or, to query a multivar:
+
+------------
+% git config --get core.gitproxy "for kernel.org$"
+------------
+
+If you want to know all the values for a multivar, do:
+
+------------
+% git config --get-all core.gitproxy
+------------
+
+If you like to live dangerous, you can replace *all* core.gitproxy by a
+new one with
+
+------------
+% git config --replace-all core.gitproxy ssh
+------------
+
+However, if you really only want to replace the line for the default proxy,
+i.e. the one without a "for ..." postfix, do something like this:
+
+------------
+% git config core.gitproxy ssh '! for '
+------------
+
+To actually match only values with an exclamation mark, you have to
+
+------------
+% git config section.key value '[!]'
+------------
+
+To add a new proxy, without altering any of the existing ones, use
+
+------------
+% git config core.gitproxy '"proxy" for example.com'
+------------
+
+
+include::config.txt[]
+
+
+Author
+------
+Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
+
+Documentation
+--------------
+Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
index 3e5f115728f580c2fa17a06f6cb12747f2fcc595..a81d68ccefe6082b2c9327692ca96c29fedb695e 100644 (file)
current branch. Normally the branch merged in is
the HEAD of the remote repository, but the choice is
determined by the branch.<name>.remote and
- branch.<name>.merge options; see gitlink:git-repo-config[1]
+ branch.<name>.merge options; see gitlink:git-config[1]
for details.
git pull origin next::
SEE ALSO
--------
-gitlink:git-fetch[1], gitlink:git-merge[1], gitlink:git-repo-config[1]
+gitlink:git-fetch[1], gitlink:git-merge[1], gitlink:git-config[1]
Author
index 5b93a8c8be3299150a9f1045c1953fb914e01a33..358c1acfc393f5c94ecf34c372c8f492b016f2ce 100644 (file)
The remote configuration is achieved using the `remote.origin.url` and
`remote.origin.fetch` configuration variables. (See
-gitlink:git-repo-config[1]).
+gitlink:git-config[1]).
Examples
--------
--------
gitlink:git-fetch[1]
gitlink:git-branch[1]
-gitlink:git-repo-config[1]
+gitlink:git-config[1]
Author
------
index 9db3d30825f247d4334262071f255707312854b7..2deba31763eb516a34d419cee5a98f7413f7f588 100644 (file)
SYNOPSIS
--------
-[verse]
-'git-repo-config' [--global] [type] name [value [value_regex]]
-'git-repo-config' [--global] [type] --add name value
-'git-repo-config' [--global] [type] --replace-all name [value [value_regex]]
-'git-repo-config' [--global] [type] --get name [value_regex]
-'git-repo-config' [--global] [type] --get-all name [value_regex]
-'git-repo-config' [--global] [type] --unset name [value_regex]
-'git-repo-config' [--global] [type] --unset-all name [value_regex]
-'git-repo-config' [--global] -l | --list
+'git-repo-config' ...
-DESCRIPTION
------------
-You can query/set/replace/unset options with this command. The name is
-actually the section and the key separated by a dot, and the value will be
-escaped.
-
-Multiple lines can be added to an option by using the '--add' option.
-If you want to update or unset an option which can occur on multiple
-lines, a POSIX regexp `value_regex` needs to be given. Only the
-existing values that match the regexp are updated or unset. If
-you want to handle the lines that do *not* match the regex, just
-prepend a single exclamation mark in front (see EXAMPLES).
-
-The type specifier can be either '--int' or '--bool', which will make
-'git-repo-config' ensure that the variable(s) are of the given type and
-convert the value to the canonical form (simple decimal number for int,
-a "true" or "false" string for bool). If no type specifier is passed,
-no checks or transformations are performed on the value.
-
-This command will fail if:
-
-. The .git/config file is invalid,
-. Can not write to .git/config,
-. no section was provided,
-. the section or key is invalid,
-. you try to unset an option which does not exist,
-. you try to unset/set an option for which multiple lines match, or
-. you use --global option without $HOME being properly set.
-
-
-OPTIONS
--------
-
---replace-all::
- Default behavior is to replace at most one line. This replaces
- all lines matching the key (and optionally the value_regex).
-
---add::
- Adds a new line to the option without altering any existing
- values. This is the same as providing '^$' as the value_regex.
-
---get::
- Get the value for a given key (optionally filtered by a regex
- matching the value). Returns error code 1 if the key was not
- found and error code 2 if multiple key values were found.
-
---get-all::
- Like get, but does not fail if the number of values for the key
- is not exactly one.
-
---get-regexp::
- Like --get-all, but interprets the name as a regular expression.
-
---global::
- Use global ~/.gitconfig file rather than the repository .git/config.
-
---unset::
- Remove the line matching the key from config file.
---unset-all::
- Remove all matching lines from config file.
-
--l, --list::
- List all variables set in config file.
-
---bool::
- git-repo-config will ensure that the output is "true" or "false"
-
---int::
- git-repo-config will ensure that the output is a simple
- decimal number. An optional value suffix of 'k', 'm', or 'g'
- in the config file will cause the value to be multiplied
- by 1024, 1048576, or 1073741824 prior to output.
-
-
-ENVIRONMENT
+DESCRIPTION
-----------
-GIT_CONFIG::
- Take the configuration from the given file instead of .git/config.
- Using the "--global" option forces this to ~/.gitconfig.
-
-GIT_CONFIG_LOCAL::
- Currently the same as $GIT_CONFIG; when Git will support global
- configuration files, this will cause it to take the configuration
- from the global configuration file in addition to the given file.
-
-
-EXAMPLE
--------
-
-Given a .git/config like this:
-
- #
- # This is the config file, and
- # a '#' or ';' character indicates
- # a comment
- #
-
- ; core variables
- [core]
- ; Don't trust file modes
- filemode = false
-
- ; Our diff algorithm
- [diff]
- external = "/usr/local/bin/gnu-diff -u"
- renames = true
-
- ; Proxy settings
- [core]
- gitproxy="ssh" for "ssh://kernel.org/"
- gitproxy="proxy-command" for kernel.org
- gitproxy="myprotocol-command" for "my://"
- gitproxy=default-proxy ; for all the rest
-
-you can set the filemode to true with
-
-------------
-% git repo-config core.filemode true
-------------
-
-The hypothetical proxy command entries actually have a postfix to discern
-what URL they apply to. Here is how to change the entry for kernel.org
-to "ssh".
-
-------------
-% git repo-config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'
-------------
-
-This makes sure that only the key/value pair for kernel.org is replaced.
-
-To delete the entry for renames, do
-
-------------
-% git repo-config --unset diff.renames
-------------
-
-If you want to delete an entry for a multivar (like core.gitproxy above),
-you have to provide a regex matching the value of exactly one line.
-
-To query the value for a given key, do
-
-------------
-% git repo-config --get core.filemode
-------------
-
-or
-
-------------
-% git repo-config core.filemode
-------------
-
-or, to query a multivar:
-
-------------
-% git repo-config --get core.gitproxy "for kernel.org$"
-------------
-
-If you want to know all the values for a multivar, do:
-
-------------
-% git repo-config --get-all core.gitproxy
-------------
-
-If you like to live dangerous, you can replace *all* core.gitproxy by a
-new one with
-
-------------
-% git repo-config --replace-all core.gitproxy ssh
-------------
-
-However, if you really only want to replace the line for the default proxy,
-i.e. the one without a "for ..." postfix, do something like this:
-
-------------
-% git repo-config core.gitproxy ssh '! for '
-------------
-
-To actually match only values with an exclamation mark, you have to
-
-------------
-% git repo-config section.key value '[!]'
-------------
-
-To add a new proxy, without altering any of the existing ones, use
-
-------------
-% git repo-config core.gitproxy '"proxy" for example.com'
-------------
-
-
-include::config.txt[]
-
-
-Author
-------
-Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
-
-Documentation
---------------
-Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.kernel.org>.
-
-GIT
----
-Part of the gitlink:git[7] suite
-
+This is a synonym for gitlink:git-config[1]. Please refer to the
+documentation of that command.
index b95ff1da9674a3fbb1486d87b8067ef5baa4ceac..aea4a6bf5faae61ca02a0cc3e8a40f5d2d735191 100644 (file)
cannot version empty directories. Enabling this flag will make
the commit to SVN act like git.
-repo-config key: svn.rmdir
+config key: svn.rmdir
-e::
--edit::
default for objects that are commits, and forced on when committing
tree objects.
-repo-config key: svn.edit
+config key: svn.edit
-l<num>::
--find-copies-harder::
gitlink:git-diff-tree[1] for more information.
[verse]
-repo-config key: svn.l
-repo-config key: svn.findcopiesharder
+config key: svn.l
+config key: svn.findcopiesharder
-A<filename>::
--authors-file=<filename>::
appropriate entry. Re-running the previous git-svn command
after the authors-file is modified should continue operation.
-repo-config key: svn.authorsfile
+config key: svn.authorsfile
-q::
--quiet::
--repack-flags are passed directly to gitlink:git-repack[1].
-repo-config key: svn.repack
-repo-config key: svn.repackflags
+config key: svn.repack
+config key: svn.repackflags
-m::
--merge::
This option may be specified multiple times, once for each
branch.
-repo-config key: svn.branch
+config key: svn.branch
-i<GIT_SVN_ID>::
--id <GIT_SVN_ID>::
started tracking a branch and never tracked the trunk it was
descended from.
-repo-config key: svn.followparent
+config key: svn.followparent
--no-metadata::
This gets rid of the git-svn-id: lines at the end of every commit.
The 'git-svn log' command will not work on repositories using this,
either.
-repo-config key: svn.nometadata
+config key: svn.nometadata
--
index 5bbae42d86dfc275740425aa3c59d6fd9eb76f94..b161c8b32b196b2e251ee65ee43e5aa0349b96b4 100644 (file)
The command honors `core.filemode` configuration variable. If
your repository is on an filesystem whose executable bits are
-unreliable, this should be set to 'false' (see gitlink:git-repo-config[1]).
+unreliable, this should be set to 'false' (see gitlink:git-config[1]).
This causes the command to ignore differences in file modes recorded
in the index and the file mode on the filesystem if they differ only on
executable bit. On such an unfortunate filesystem, you may
See Also
--------
-gitlink:git-repo-config[1]
+gitlink:git-config[1]
Author
index 8a50638e98039dc3a2462488f9fe3513f5dfb0a2..9b0de1c111d7b58cb8d431d90814d1f1530f5e0d 100644 (file)
Cause the logical variables to be listed. In addition, all the
variables of the git configuration file .git/config are listed
as well. (However, the configuration variables listing functionality
- is deprecated in favor of `git-repo-config -l`.)
+ is deprecated in favor of `git-config -l`.)
EXAMPLE
--------
--------
gitlink:git-commit-tree[1]
gitlink:git-tag[1]
-gitlink:git-repo-config[1]
+gitlink:git-config[1]
Author
------
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 9761de36b3cad64bc3bb3b91da7d4fe8656875a6..7cd346798615eb31fbf4d6b8a329a7ff36d78741 100644 (file)
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
also want to read link:cvs-migration.html[CVS migration].
The COMMAND is either a name of a Git command (see below) or an alias
-as defined in the configuration file (see gitlink:git-repo-config[1]).
+as defined in the configuration file (see gitlink:git-config[1]).
OPTIONS
-------
diff --git a/Documentation/howto/setup-git-server-over-http.txt b/Documentation/howto/setup-git-server-over-http.txt
index a202f3a460b4446f085977f7423d1f43e189e5ef..8eadc2049402cc21fd80818ca9f29d15f4cd8462 100644 (file)
Now, add the remote in your existing repository which contains the project
you want to export:
- $ git-repo-config remote.upload.url \
+ $ git-config remote.upload.url \
http://<username>@<servername>/my-new-repo.git/
It is important to put the last '/'; Without it, the server will send
This pushes branch 'master' (which is assumed to be the branch you
want to export) to repository called 'upload', which we previously
-defined with git-repo-config.
+defined with git-config.
Troubleshooting:
index c27a4505d48c838b33e07bd3a2878211dfeee15d..adb1e327502e274382417ce2d4f305d4dbe88649 100644 (file)
way to do so is:
------------------------------------------------
-$ git repo-config --global user.name "Your Name Comes Here"
-$ git repo-config --global user.email you@yourdomain.example.com
+$ git config --global user.name "Your Name Comes Here"
+$ git config --global user.email you@yourdomain.example.com
------------------------------------------------
used for pulls:
-------------------------------------
-$ git repo-config --get remote.origin.url
+$ git config --get remote.origin.url
/home/bob/myrepo
-------------------------------------
(The complete configuration created by git-clone is visible using
-"git repo-config -l", and the gitlink:git-repo-config[1] man page
+"git config -l", and the gitlink:git-config[1] man page
explains the meaning of each option.)
Git also keeps a pristine copy of Alice's master branch under the
diff --git a/Makefile b/Makefile
index 07246f3d189ba670c96542294263a8bd4d3bd07a..fd8a522efa110d9d2b178201dd9b66bffda7a46f 100644 (file)
--- a/Makefile
+++ b/Makefile
BUILT_INS = \
git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \
- git-get-tar-commit-id$X git-init$X \
+ git-get-tar-commit-id$X git-init$X git-repo-config$X \
$(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
# what 'all' will build and 'install' will install, in gitexecdir
builtin-push.o \
builtin-read-tree.o \
builtin-reflog.o \
- builtin-repo-config.o \
+ builtin-config.o \
builtin-rerere.o \
builtin-rev-list.o \
builtin-rev-parse.o \
diff --git a/builtin-config.c b/builtin-config.c
--- /dev/null
+++ b/builtin-config.c
@@ -0,0 +1,220 @@
+#include "builtin.h"
+#include "cache.h"
+
+static const char git_config_set_usage[] =
+"git-config [ --global ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --list";
+
+static char *key;
+static regex_t *key_regexp;
+static regex_t *regexp;
+static int show_keys;
+static int use_key_regexp;
+static int do_all;
+static int do_not_match;
+static int seen;
+static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;
+
+static int show_all_config(const char *key_, const char *value_)
+{
+ if (value_)
+ printf("%s=%s\n", key_, value_);
+ else
+ printf("%s\n", key_);
+ return 0;
+}
+
+static int show_config(const char* key_, const char* value_)
+{
+ char value[256];
+ const char *vptr = value;
+ int dup_error = 0;
+
+ if (!use_key_regexp && strcmp(key_, key))
+ return 0;
+ if (use_key_regexp && regexec(key_regexp, key_, 0, NULL, 0))
+ return 0;
+ if (regexp != NULL &&
+ (do_not_match ^
+ regexec(regexp, (value_?value_:""), 0, NULL, 0)))
+ return 0;
+
+ if (show_keys)
+ printf("%s ", key_);
+ if (seen && !do_all)
+ dup_error = 1;
+ if (type == T_INT)
+ sprintf(value, "%d", git_config_int(key_, value_?value_:""));
+ else if (type == T_BOOL)
+ vptr = git_config_bool(key_, value_) ? "true" : "false";
+ else
+ vptr = value_?value_:"";
+ seen++;
+ if (dup_error) {
+ error("More than one value for the key %s: %s",
+ key_, vptr);
+ }
+ else
+ printf("%s\n", vptr);
+
+ return 0;
+}
+
+static int get_value(const char* key_, const char* regex_)
+{
+ int ret = -1;
+ char *tl;
+ char *global = NULL, *repo_config = NULL;
+ const char *local;
+
+ local = getenv(CONFIG_ENVIRONMENT);
+ if (!local) {
+ const char *home = getenv("HOME");
+ local = getenv(CONFIG_LOCAL_ENVIRONMENT);
+ if (!local)
+ local = repo_config = xstrdup(git_path("config"));
+ if (home)
+ global = xstrdup(mkpath("%s/.gitconfig", home));
+ }
+
+ key = xstrdup(key_);
+ for (tl=key+strlen(key)-1; tl >= key && *tl != '.'; --tl)
+ *tl = tolower(*tl);
+ for (tl=key; *tl && *tl != '.'; ++tl)
+ *tl = tolower(*tl);
+
+ if (use_key_regexp) {
+ key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
+ if (regcomp(key_regexp, key, REG_EXTENDED)) {
+ fprintf(stderr, "Invalid key pattern: %s\n", key_);
+ goto free_strings;
+ }
+ }
+
+ if (regex_) {
+ if (regex_[0] == '!') {
+ do_not_match = 1;
+ regex_++;
+ }
+
+ regexp = (regex_t*)xmalloc(sizeof(regex_t));
+ if (regcomp(regexp, regex_, REG_EXTENDED)) {
+ fprintf(stderr, "Invalid pattern: %s\n", regex_);
+ goto free_strings;
+ }
+ }
+
+ if (do_all && global)
+ git_config_from_file(show_config, global);
+ git_config_from_file(show_config, local);
+ if (!do_all && !seen && global)
+ git_config_from_file(show_config, global);
+
+ free(key);
+ if (regexp) {
+ regfree(regexp);
+ free(regexp);
+ }
+
+ if (do_all)
+ ret = !seen;
+ else
+ ret = (seen == 1) ? 0 : seen > 1 ? 2 : 1;
+
+free_strings:
+ free(repo_config);
+ free(global);
+ return ret;
+}
+
+int cmd_config(int argc, const char **argv, const char *prefix)
+{
+ int nongit = 0;
+ setup_git_directory_gently(&nongit);
+
+ while (1 < argc) {
+ if (!strcmp(argv[1], "--int"))
+ type = T_INT;
+ else if (!strcmp(argv[1], "--bool"))
+ type = T_BOOL;
+ else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
+ return git_config(show_all_config);
+ else if (!strcmp(argv[1], "--global")) {
+ char *home = getenv("HOME");
+ if (home) {
+ char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
+ setenv("GIT_CONFIG", user_config, 1);
+ free(user_config);
+ } else {
+ die("$HOME not set");
+ }
+ } else if (!strcmp(argv[1], "--rename-section")) {
+ int ret;
+ if (argc != 4)
+ usage(git_config_set_usage);
+ ret = git_config_rename_section(argv[2], argv[3]);
+ if (ret < 0)
+ return ret;
+ if (ret == 0) {
+ fprintf(stderr, "No such section!\n");
+ return 1;
+ }
+ return 0;
+ } else
+ break;
+ argc--;
+ argv++;
+ }
+
+ switch (argc) {
+ case 2:
+ return get_value(argv[1], NULL);
+ case 3:
+ if (!strcmp(argv[1], "--unset"))
+ return git_config_set(argv[2], NULL);
+ else if (!strcmp(argv[1], "--unset-all"))
+ return git_config_set_multivar(argv[2], NULL, NULL, 1);
+ else if (!strcmp(argv[1], "--get"))
+ return get_value(argv[2], NULL);
+ else if (!strcmp(argv[1], "--get-all")) {
+ do_all = 1;
+ return get_value(argv[2], NULL);
+ } else if (!strcmp(argv[1], "--get-regexp")) {
+ show_keys = 1;
+ use_key_regexp = 1;
+ do_all = 1;
+ return get_value(argv[2], NULL);
+ } else
+
+ return git_config_set(argv[1], argv[2]);
+ case 4:
+ if (!strcmp(argv[1], "--unset"))
+ return git_config_set_multivar(argv[2], NULL, argv[3], 0);
+ else if (!strcmp(argv[1], "--unset-all"))
+ return git_config_set_multivar(argv[2], NULL, argv[3], 1);
+ else if (!strcmp(argv[1], "--get"))
+ return get_value(argv[2], argv[3]);
+ else if (!strcmp(argv[1], "--get-all")) {
+ do_all = 1;
+ return get_value(argv[2], argv[3]);
+ } else if (!strcmp(argv[1], "--get-regexp")) {
+ show_keys = 1;
+ use_key_regexp = 1;
+ do_all = 1;
+ return get_value(argv[2], argv[3]);
+ } else if (!strcmp(argv[1], "--add"))
+ return git_config_set_multivar(argv[2], argv[3], "^$", 0);
+ else if (!strcmp(argv[1], "--replace-all"))
+
+ return git_config_set_multivar(argv[2], argv[3], NULL, 1);
+ else
+
+ return git_config_set_multivar(argv[1], argv[2], argv[3], 0);
+ case 5:
+ if (!strcmp(argv[1], "--replace-all"))
+ return git_config_set_multivar(argv[2], argv[3], argv[4], 1);
+ case 1:
+ default:
+ usage(git_config_set_usage);
+ }
+ return 0;
+}
diff --git a/builtin-repo-config.c b/builtin-repo-config.c
--- a/builtin-repo-config.c
+++ /dev/null
@@ -1,220 +0,0 @@
-#include "builtin.h"
-#include "cache.h"
-
-static const char git_config_set_usage[] =
-"git-repo-config [ --global ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --list";
-
-static char *key;
-static regex_t *key_regexp;
-static regex_t *regexp;
-static int show_keys;
-static int use_key_regexp;
-static int do_all;
-static int do_not_match;
-static int seen;
-static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;
-
-static int show_all_config(const char *key_, const char *value_)
-{
- if (value_)
- printf("%s=%s\n", key_, value_);
- else
- printf("%s\n", key_);
- return 0;
-}
-
-static int show_config(const char* key_, const char* value_)
-{
- char value[256];
- const char *vptr = value;
- int dup_error = 0;
-
- if (!use_key_regexp && strcmp(key_, key))
- return 0;
- if (use_key_regexp && regexec(key_regexp, key_, 0, NULL, 0))
- return 0;
- if (regexp != NULL &&
- (do_not_match ^
- regexec(regexp, (value_?value_:""), 0, NULL, 0)))
- return 0;
-
- if (show_keys)
- printf("%s ", key_);
- if (seen && !do_all)
- dup_error = 1;
- if (type == T_INT)
- sprintf(value, "%d", git_config_int(key_, value_?value_:""));
- else if (type == T_BOOL)
- vptr = git_config_bool(key_, value_) ? "true" : "false";
- else
- vptr = value_?value_:"";
- seen++;
- if (dup_error) {
- error("More than one value for the key %s: %s",
- key_, vptr);
- }
- else
- printf("%s\n", vptr);
-
- return 0;
-}
-
-static int get_value(const char* key_, const char* regex_)
-{
- int ret = -1;
- char *tl;
- char *global = NULL, *repo_config = NULL;
- const char *local;
-
- local = getenv(CONFIG_ENVIRONMENT);
- if (!local) {
- const char *home = getenv("HOME");
- local = getenv(CONFIG_LOCAL_ENVIRONMENT);
- if (!local)
- local = repo_config = xstrdup(git_path("config"));
- if (home)
- global = xstrdup(mkpath("%s/.gitconfig", home));
- }
-
- key = xstrdup(key_);
- for (tl=key+strlen(key)-1; tl >= key && *tl != '.'; --tl)
- *tl = tolower(*tl);
- for (tl=key; *tl && *tl != '.'; ++tl)
- *tl = tolower(*tl);
-
- if (use_key_regexp) {
- key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
- if (regcomp(key_regexp, key, REG_EXTENDED)) {
- fprintf(stderr, "Invalid key pattern: %s\n", key_);
- goto free_strings;
- }
- }
-
- if (regex_) {
- if (regex_[0] == '!') {
- do_not_match = 1;
- regex_++;
- }
-
- regexp = (regex_t*)xmalloc(sizeof(regex_t));
- if (regcomp(regexp, regex_, REG_EXTENDED)) {
- fprintf(stderr, "Invalid pattern: %s\n", regex_);
- goto free_strings;
- }
- }
-
- if (do_all && global)
- git_config_from_file(show_config, global);
- git_config_from_file(show_config, local);
- if (!do_all && !seen && global)
- git_config_from_file(show_config, global);
-
- free(key);
- if (regexp) {
- regfree(regexp);
- free(regexp);
- }
-
- if (do_all)
- ret = !seen;
- else
- ret = (seen == 1) ? 0 : seen > 1 ? 2 : 1;
-
-free_strings:
- free(repo_config);
- free(global);
- return ret;
-}
-
-int cmd_repo_config(int argc, const char **argv, const char *prefix)
-{
- int nongit = 0;
- setup_git_directory_gently(&nongit);
-
- while (1 < argc) {
- if (!strcmp(argv[1], "--int"))
- type = T_INT;
- else if (!strcmp(argv[1], "--bool"))
- type = T_BOOL;
- else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
- return git_config(show_all_config);
- else if (!strcmp(argv[1], "--global")) {
- char *home = getenv("HOME");
- if (home) {
- char *user_config = xstrdup(mkpath("%s/.gitconfig", home));
- setenv("GIT_CONFIG", user_config, 1);
- free(user_config);
- } else {
- die("$HOME not set");
- }
- } else if (!strcmp(argv[1], "--rename-section")) {
- int ret;
- if (argc != 4)
- usage(git_config_set_usage);
- ret = git_config_rename_section(argv[2], argv[3]);
- if (ret < 0)
- return ret;
- if (ret == 0) {
- fprintf(stderr, "No such section!\n");
- return 1;
- }
- return 0;
- } else
- break;
- argc--;
- argv++;
- }
-
- switch (argc) {
- case 2:
- return get_value(argv[1], NULL);
- case 3:
- if (!strcmp(argv[1], "--unset"))
- return git_config_set(argv[2], NULL);
- else if (!strcmp(argv[1], "--unset-all"))
- return git_config_set_multivar(argv[2], NULL, NULL, 1);
- else if (!strcmp(argv[1], "--get"))
- return get_value(argv[2], NULL);
- else if (!strcmp(argv[1], "--get-all")) {
- do_all = 1;
- return get_value(argv[2], NULL);
- } else if (!strcmp(argv[1], "--get-regexp")) {
- show_keys = 1;
- use_key_regexp = 1;
- do_all = 1;
- return get_value(argv[2], NULL);
- } else
-
- return git_config_set(argv[1], argv[2]);
- case 4:
- if (!strcmp(argv[1], "--unset"))
- return git_config_set_multivar(argv[2], NULL, argv[3], 0);
- else if (!strcmp(argv[1], "--unset-all"))
- return git_config_set_multivar(argv[2], NULL, argv[3], 1);
- else if (!strcmp(argv[1], "--get"))
- return get_value(argv[2], argv[3]);
- else if (!strcmp(argv[1], "--get-all")) {
- do_all = 1;
- return get_value(argv[2], argv[3]);
- } else if (!strcmp(argv[1], "--get-regexp")) {
- show_keys = 1;
- use_key_regexp = 1;
- do_all = 1;
- return get_value(argv[2], argv[3]);
- } else if (!strcmp(argv[1], "--add"))
- return git_config_set_multivar(argv[2], argv[3], "^$", 0);
- else if (!strcmp(argv[1], "--replace-all"))
-
- return git_config_set_multivar(argv[2], argv[3], NULL, 1);
- else
-
- return git_config_set_multivar(argv[1], argv[2], argv[3], 0);
- case 5:
- if (!strcmp(argv[1], "--replace-all"))
- return git_config_set_multivar(argv[2], argv[3], argv[4], 1);
- case 1:
- default:
- usage(git_config_set_usage);
- }
- return 0;
-}
diff --git a/builtin.h b/builtin.h
index 0b3c9f62efed895bcfebe31f1164ac991ee01d41..cfe5990740b8fd00287cfe747ef83088c98f8754 100644 (file)
--- a/builtin.h
+++ b/builtin.h
extern int cmd_push(int argc, const char **argv, const char *prefix);
extern int cmd_read_tree(int argc, const char **argv, const char *prefix);
extern int cmd_reflog(int argc, const char **argv, const char *prefix);
-extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
+extern int cmd_config(int argc, const char **argv, const char *prefix);
extern int cmd_rerere(int argc, const char **argv, const char *prefix);
extern int cmd_rev_list(int argc, const char **argv, const char *prefix);
extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);
index 7c7520ea29dfb26ffafc355ea739046b6d821e28..83c69ecf489d4730ccb24a6340c1bdb548daf9db 100755 (executable)
echo ${i#$d/remotes/}
done
[ "$ngoff" ] && shopt -u nullglob
- for i in $(git --git-dir="$d" repo-config --list); do
+ for i in $(git --git-dir="$d" config --list); do
case "$i" in
remote.*.url=*)
i="${i#remote.}"
__git_aliases ()
{
local i IFS=$'\n'
- for i in $(git --git-dir="$(__gitdir)" repo-config --list); do
+ for i in $(git --git-dir="$(__gitdir)" config --list); do
case "$i" in
alias.*)
i="${i#alias.}"
__git_aliased_command ()
{
local word cmdline=$(git --git-dir="$(__gitdir)" \
- repo-config --get "alias.$1")
+ config --get "alias.$1")
for word in $cmdline; do
if [ "${word##-*}" ]; then
echo $word
COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}
-_git_repo_config ()
+_git_config ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local prv="${COMP_WORDS[COMP_CWORD-1]}"
checkout) _git_checkout ;;
cherry-pick) _git_cherry_pick ;;
commit) _git_commit ;;
+ config) _git_config ;;
diff) _git_diff ;;
diff-tree) _git_diff_tree ;;
fetch) _git_fetch ;;
pull) _git_pull ;;
push) _git_push ;;
rebase) _git_rebase ;;
- repo-config) _git_repo_config ;;
+ repo-config) _git_config ;;
reset) _git_reset ;;
show) _git_show ;;
show-branch) _git_log ;;
complete -o default -o nospace -F _git_pull git-pull
complete -o default -o nospace -F _git_push git-push
complete -o default -F _git_rebase git-rebase
-complete -o default -F _git_repo_config git-repo-config
+complete -o default -F _git_config git-config
complete -o default -F _git_reset git-reset
complete -o default -o nospace -F _git_show git-show
complete -o default -o nospace -F _git_log git-show-branch
complete -o default -F _git_merge_base git-merge-base.exe
complete -o default -F _git_name_rev git-name-rev.exe
complete -o default -o nospace -F _git_push git-push.exe
-complete -o default -F _git_repo_config git-repo-config
+complete -o default -F _git_config git-config
complete -o default -o nospace -F _git_show git-show.exe
complete -o default -o nospace -F _git_log git-show-branch.exe
complete -o default -o nospace -F _git_log git-whatchanged.exe
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index d90ba816e0521ccc0ee20592cbea3fad74fcb1a3..24629eb3e211505728c77db820618021203241ae 100644 (file)
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
"Return the name to use as GIT_COMMITTER_NAME."
; copied from log-edit
(or git-committer-name
- (git-repo-config "user.name")
+ (git-config "user.name")
(and (boundp 'add-log-full-name) add-log-full-name)
(and (fboundp 'user-full-name) (user-full-name))
(and (boundp 'user-full-name) user-full-name)))
"Return the email address to use as GIT_COMMITTER_EMAIL."
; copied from log-edit
(or git-committer-email
- (git-repo-config "user.email")
+ (git-config "user.email")
(and (boundp 'add-log-mailing-address) add-log-mailing-address)
(and (fboundp 'user-mail-address) (user-mail-address))
(and (boundp 'user-mail-address) user-mail-address)))
(git-get-string-sha1
(git-call-process-env-string nil "rev-parse" rev)))
-(defun git-repo-config (key)
+(defun git-config (key)
"Retrieve the value associated to KEY in the git repository config file."
- (let ((str (git-call-process-env-string nil "repo-config" key)))
+ (let ((str (git-call-process-env-string nil "config" key)))
(and str (car (split-string str "\n")))))
(defun git-symbolic-ref (ref)
index 3b6bdceeeb20daf3242cf98d12f8f4d94cffc6e8..521b2fcd32da4103d0c916af0ae44fbe53ed282a 100755 (executable)
--- a/contrib/gitview/gitview
+++ b/contrib/gitview/gitview
fp.close()
def get_encoding(self):
- fp = os.popen("git repo-config --get i18n.commitencoding")
+ fp = os.popen("git config --get i18n.commitencoding")
self.encoding=string.strip(fp.readline())
fp.close()
if (self.encoding == ""):
index b996996bfbff614b3bf2f30c04a05c7d0caf45ec..dc09eae972711496aa390cb99b3017a936ce1afc 100644 (file)
mv "$GIT_DIR"/remotes "$GIT_DIR"/remotes.old
fi ;;
*)
- echo "git-repo-config $key "$value" $regex"
- git-repo-config $key "$value" $regex || error=1 ;;
+ echo "git-config $key "$value" $regex"
+ git-config $key "$value" $regex || error=1 ;;
esac
done
fi
diff --git a/git-clone.sh b/git-clone.sh
index ced7dfba3e205214e9e88d25d58017649e7ffe07..1531da52cb5c390bc11a3a10ffc0075fa2b59b9c 100755 (executable)
--- a/git-clone.sh
+++ b/git-clone.sh
clone_tmp="$GIT_DIR/clone-tmp" &&
mkdir -p "$clone_tmp" || exit 1
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
- "`git-repo-config --bool http.noEPSV`" = true ]; then
+ "`git-config --bool http.noEPSV`" = true ]; then
curl_extra_args="${curl_extra_args} --disable-epsv"
fi
http_fetch "$1/info/refs" "$clone_tmp/refs" ||
git-update-ref HEAD "$head_sha1" &&
# Upstream URL
- git-repo-config remote."$origin".url "$repo" &&
+ git-config remote."$origin".url "$repo" &&
# Set up the mappings to track the remote branches.
- git-repo-config remote."$origin".fetch \
+ git-config remote."$origin".fetch \
"+refs/heads/*:$remote_top/*" '^$' &&
rm -f "refs/remotes/$origin/HEAD"
git-symbolic-ref "refs/remotes/$origin/HEAD" \
"refs/remotes/$origin/$head_points_at" &&
- git-repo-config branch."$head_points_at".remote "$origin" &&
- git-repo-config branch."$head_points_at".merge "refs/heads/$head_points_at"
+ git-config branch."$head_points_at".remote "$origin" &&
+ git-config branch."$head_points_at".merge "refs/heads/$head_points_at"
esac
case "$no_checkout" in
diff --git a/git-commit.sh b/git-commit.sh
index d8c236b24039a20c9490d86e96bba39edddde7c9..85c278afabef75dd09386b1586c85c6c812bcd5a 100755 (executable)
--- a/git-commit.sh
+++ b/git-commit.sh
fi
elif test "$use_commit" != ""
then
- encoding=$(git repo-config i18n.commitencoding || echo UTF-8)
+ encoding=$(git config i18n.commitencoding || echo UTF-8)
git show -s --pretty=raw --encoding="$encoding" "$use_commit" |
sed -e '1,/^$/d' -e 's/^ //'
elif test -f "$GIT_DIR/MERGE_MSG"
q
}
'
- encoding=$(git repo-config i18n.commitencoding || echo UTF-8)
+ encoding=$(git config i18n.commitencoding || echo UTF-8)
set_author_env=`git show -s --pretty=raw --encoding="$encoding" "$use_commit" |
LANG=C LC_ALL=C sed -ne "$pick_author_script"`
eval "$set_author_env"
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index e18e90173190f9ffc9c61aaa904e8cf0b916cc37..9371788fab427ab8605cb8c993a1520e36ad819e 100755 (executable)
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
return 0;
}
- my @gitvars = `git-repo-config -l`;
+ my @gitvars = `git-config -l`;
if ($?) {
- print "E problems executing git-repo-config on the server -- this is not a git repository or the PATH is not set correctly.\n";
+ print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n";
print "E \n";
- print "error 1 - problem executing git-repo-config\n";
+ print "error 1 - problem executing git-config\n";
return 0;
}
foreach my $line ( @gitvars )
diff --git a/git-fetch.sh b/git-fetch.sh
index 61c8cf477384fbcaa125f4a90883257492f98710..c1f6e1e84147d7bedd32e4534a5bb9cdb83a52e5 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
curl_extra_args="-k"
fi
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
- "`git-repo-config --bool http.noEPSV`" = true ]; then
+ "`git-config --bool http.noEPSV`" = true ]; then
noepsv_opt="--disable-epsv"
fi
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 80adc8307b4310440b5de7df82c5200cc2c45cbb..cbc7418e3501b37a701a5177157733d97b405376 100755 (executable)
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
fqgitdir="$PWD/$GIT_DIR" ;;
esac
-local="`git repo-config --bool --get instaweb.local`"
-httpd="`git repo-config --get instaweb.httpd`"
-browser="`git repo-config --get instaweb.browser`"
-port=`git repo-config --get instaweb.port`
-module_path="`git repo-config --get instaweb.modulepath`"
+local="`git config --bool --get instaweb.local`"
+httpd="`git config --get instaweb.httpd`"
+browser="`git config --get instaweb.browser`"
+port=`git config --get instaweb.port`
+module_path="`git config --get instaweb.modulepath`"
conf=$GIT_DIR/gitweb/httpd.conf
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index dd22783824ab8d01bba9e589aa0f60d59c859272..e6f574b99b56648e277d128911eb875380f279db 100755 (executable)
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
curl_extra_args="-k"
fi
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
- "`git-repo-config --bool http.noEPSV`" = true ]; then
+ "`git-config --bool http.noEPSV`" = true ]; then
curl_extra_args="${curl_extra_args} --disable-epsv"
fi
curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
diff --git a/git-merge.sh b/git-merge.sh
index 656869101a86c7a593a489408818725ec85c15fa..04a5eb0f297a691fa0520d1729ea20bd66a53bd9 100755 (executable)
--- a/git-merge.sh
+++ b/git-merge.sh
'')
case "$#" in
1)
- var="`git-repo-config --get pull.twohead`"
+ var="`git-config --get pull.twohead`"
if test -n "$var"
then
use_strategies="$var"
use_strategies="$default_twohead_strategies"
fi ;;
*)
- var="`git-repo-config --get pull.octopus`"
+ var="`git-config --get pull.octopus`"
if test -n "$var"
then
use_strategies="$var"
diff --git a/git-p4import.py b/git-p4import.py
index 5c56cace0ef132c117e9e0f5624eaf375a5b84d2..60a758bfe3bf535733612d4a0843fb42055f4c80 100644 (file)
--- a/git-p4import.py
+++ b/git-p4import.py
def get_config(self, variable):
try:
- return self.git("repo-config --get %s" % variable)[0].rstrip()
+ return self.git("config --get %s" % variable)[0].rstrip()
except:
return None
def set_config(self, variable, value):
try:
- self.git("repo-config %s %s"%(variable, value) )
+ self.git("config %s %s"%(variable, value) )
except:
die("Could not set %s to " % variable, value)
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 7e87f2e06e6e491d7c518d332bfa036cca081ea2..9d269671de65d970446a31cd0d8962a5e05332b3 100755 (executable)
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
echo ''
;;
*)
- if test "$(git-repo-config --get "remote.$1.url")"
+ if test "$(git-config --get "remote.$1.url")"
then
echo config
elif test -f "$GIT_DIR/remotes/$1"
echo "$1"
;;
config)
- git-repo-config --get "remote.$1.url"
+ git-config --get "remote.$1.url"
;;
remotes)
sed -ne '/^URL: */{
get_default_remote () {
curr_branch=$(git-symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
- origin=$(git-repo-config --get "branch.$curr_branch.remote")
+ origin=$(git-config --get "branch.$curr_branch.remote")
echo ${origin:-origin}
}
'' | branches)
;; # no default push mapping, just send matching refs.
config)
- git-repo-config --get-all "remote.$1.push" ;;
+ git-config --get-all "remote.$1.push" ;;
remotes)
sed -ne '/^Push: */{
s///p
then
curr_branch=$(git-symbolic-ref -q HEAD | \
sed -e 's|^refs/heads/||')
- merge_branches=$(git-repo-config \
+ merge_branches=$(git-config \
--get-all "branch.${curr_branch}.merge")
fi
if test -z "$merge_branches" && test $is_explicit != explicit
echo "HEAD:" ;;
config)
canon_refs_list_for_fetch -d "$1" \
- $(git-repo-config --get-all "remote.$1.fetch") ;;
+ $(git-config --get-all "remote.$1.fetch") ;;
branches)
remote_branch=$(sed -ne '/#/s/.*#//p' "$GIT_DIR/branches/$1")
case "$remote_branch" in '') remote_branch=master ;; esac
data_source=$(get_data_source "$1")
case "$data_source" in
config)
- uplp=$(git-repo-config --get "remote.$1.uploadpack")
+ uplp=$(git-config --get "remote.$1.uploadpack")
echo ${uplp:-git-upload-pack}
;;
*)
diff --git a/git-remote.perl b/git-remote.perl
index fc055b6d9577b8667e104a9e1528f43cfe29f7e3..c813fe14518fc12cb8260d053d0b87d834eed47d 100755 (executable)
--- a/git-remote.perl
+++ b/git-remote.perl
my ($git) = @_;
my %seen = ();
my @remotes = eval {
- $git->command(qw(repo-config --get-regexp), '^remote\.');
+ $git->command(qw(config --get-regexp), '^remote\.');
};
for (@remotes) {
if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
my ($git) = @_;
my %seen = ();
my @branches = eval {
- $git->command(qw(repo-config --get-regexp), '^branch\.');
+ $git->command(qw(config --get-regexp), '^branch\.');
};
for (@branches) {
if (/^branch\.([^.]*)\.(\S*)\s+(.*)$/) {
print STDERR "remote $name already exists.\n";
exit(1);
}
- $git->command('repo-config', "remote.$name.url", $url);
- $git->command('repo-config', "remote.$name.fetch",
+ $git->command('config', "remote.$name.url", $url);
+ $git->command('config', "remote.$name.fetch",
"+refs/heads/*:refs/remotes/$name/*");
}
diff --git a/git-repack.sh b/git-repack.sh
index da8e67f7a558229aa09216e7eb74713ca6c970cd..ddfa8b44a17f1ea7ff039bca1d6132ba07e5cf12 100755 (executable)
--- a/git-repack.sh
+++ b/git-repack.sh
# Later we will default repack.UseDeltaBaseOffset to true
default_dbo=false
-case "`git repo-config --bool repack.usedeltabaseoffset ||
+case "`git config --bool repack.usedeltabaseoffset ||
echo $default_dbo`" in
true)
extra="$extra --delta-base-offset" ;;
diff --git a/git-revert.sh b/git-revert.sh
index bb8f1ca24aadf47734049b740be8f539e0e9325d..866d622d2344a4bd1fea579fd5d1d6aee6615eee 100755 (executable)
--- a/git-revert.sh
+++ b/git-revert.sh
git-rev-parse --verify "$commit^2" >/dev/null 2>&1 &&
die "Cannot run $me a multi-parent commit."
-encoding=$(git repo-config i18n.commitencoding || echo UTF-8)
+encoding=$(git config i18n.commitencoding || echo UTF-8)
# "commit" is an existing commit. We would want to apply
# the difference it introduces since its first parent "prev"
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 6b1c1423ebb7fde53aae566fa09211d331c422bc..b4aa4b2f4e6b53388ea9ec0ac13316ae0d0d4458 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
}
is_bare_repository () {
- git-repo-config --bool --get core.bare ||
+ git-config --bool --get core.bare ||
case "$GIT_DIR" in
.git | */.git) echo false ;;
*) echo true ;;
diff --git a/git-svn.perl b/git-svn.perl
index 83ec03d4786a39f250f8f83c075c9dabf782b1db..68156fc8a5d3e886fae61dae531f647e35b4899d 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
"$trunk_url ($_trunk)\n";
}
init($trunk_url);
- command_noisy('repo-config', 'svn.trunk', $trunk_url);
+ command_noisy('config', 'svn.trunk', $trunk_url);
}
}
$_prefix = '' unless defined $_prefix;
return 1 if $_color;
my ($dc, $dcvar);
$dcvar = 'color.diff';
- $dc = `git-repo-config --get $dcvar`;
+ $dc = `git-config --get $dcvar`;
if ($dc eq '') {
# nothing at all; fallback to "diff.color"
$dcvar = 'diff.color';
- $dc = `git-repo-config --get $dcvar`;
+ $dc = `git-config --get $dcvar`;
}
chomp($dc);
if ($dc eq 'auto') {
my $pc;
- $pc = `git-repo-config --get color.pager`;
+ $pc = `git-config --get color.pager`;
if ($pc eq '') {
# does not have it -- fallback to pager.color
- $pc = `git-repo-config --bool --get pager.color`;
+ $pc = `git-config --bool --get pager.color`;
}
else {
- $pc = `git-repo-config --bool --get color.pager`;
+ $pc = `git-config --bool --get color.pager`;
if ($?) {
$pc = 'false';
}
}
return 0 if $dc eq 'never';
return 1 if $dc eq 'always';
- chomp($dc = `git-repo-config --bool --get $dcvar`);
+ chomp($dc = `git-config --bool --get $dcvar`);
return ($dc eq 'true');
}
waitpid $pid, 0;
croak $? if $?;
my ($n) = ($switch =~ /^--(\w+)/);
- command_noisy('repo-config', "svn.$n", $full_url);
+ command_noisy('config', "svn.$n", $full_url);
}
sub common_prefix {
%tree_map = ();
}
-# convert GetOpt::Long specs for use by git-repo-config
+# convert GetOpt::Long specs for use by git-config
sub read_repo_config {
return unless -d $GIT_DIR;
my $opts = shift;
my $v = $opts->{$o};
my ($key) = ($o =~ /^([a-z\-]+)/);
$key =~ s/-//g;
- my $arg = 'git-repo-config';
+ my $arg = 'git-config';
$arg .= ' --int' if ($o =~ /[:=]i$/);
$arg .= ' --bool' if ($o !~ /[:=][sfi]$/);
if (ref $v eq 'ARRAY') {
index e9febc389af38c891a6f948543fa2dd13b74b560..d21e5e505c9622efcfd6eb147a5d4a0528660e0e 100644 (file)
--- a/git.c
+++ b/git.c
{ "check-ref-format", cmd_check_ref_format },
{ "cherry", cmd_cherry, RUN_SETUP },
{ "commit-tree", cmd_commit_tree, RUN_SETUP },
+ { "config", cmd_config },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "describe", cmd_describe, RUN_SETUP },
{ "diff", cmd_diff, RUN_SETUP | USE_PAGER },
{ "push", cmd_push, RUN_SETUP },
{ "read-tree", cmd_read_tree, RUN_SETUP },
{ "reflog", cmd_reflog, RUN_SETUP },
- { "repo-config", cmd_repo_config },
+ { "repo-config", cmd_config },
{ "rerere", cmd_rerere, RUN_SETUP },
{ "rev-list", cmd_rev_list, RUN_SETUP },
{ "rev-parse", cmd_rev_parse, RUN_SETUP },
index 031c829f267d5926ebdf689fea1d8cc1c79cb141..31d0aad4502f09e26343525f985b4afffe057955 100755 (executable)
--- a/gitk
+++ b/gitk
set gitencoding {}
catch {
- set gitencoding [exec git repo-config --get i18n.commitencoding]
+ set gitencoding [exec git config --get i18n.commitencoding]
}
if {$gitencoding == ""} {
set gitencoding "utf-8"
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 88af2e638061f54cfd7f6ffc6ae777ef2756c603..b606c1d3e7d36f432965bfffd808b127f2cf1887 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
$key =~ s/^gitweb\.//;
return if ($key =~ m/\W/);
- my @x = (git_cmd(), 'repo-config');
+ my @x = (git_cmd(), 'config');
if (defined $type) { push @x, $type; }
push @x, "--get";
push @x, "gitweb.$key";
index 6de7eeae4d47834b0f680be38cde59071f380536..a6fc7b5e11e3f232a7becd62223cc23c5eb68ccc 100644 (file)
--- a/ident.c
+++ b/ident.c
"\n"
"Run\n"
"\n"
-" git repo-config user.email \"you@email.com\"\n"
-" git repo-config user.name \"Your Name\"\n"
+" git config user.email \"you@email.com\"\n"
+" git config user.name \"Your Name\"\n"
"\n"
"To set the identity in this repository.\n"
"Add --global to set your account\'s default\n"
diff --git a/perl/Git.pm b/perl/Git.pm
index c1729bafd20d38d56b3178356e50c72b2822f83c..5d1ccaa125e8322b687a70af5da98798034bc971 100644 (file)
--- a/perl/Git.pm
+++ b/perl/Git.pm
=item config ( VARIABLE )
-Retrieve the configuration C<VARIABLE> in the same manner as C<repo-config>
+Retrieve the configuration C<VARIABLE> in the same manner as C<config>
does. In scalar context requires the variable to be set only one time
(exception is thrown otherwise), in array context returns allows the
variable to be set multiple times and returns all the values.
Must be called on a repository instance.
-This currently wraps command('repo-config') so it is not so fast.
+This currently wraps command('config') so it is not so fast.
=cut
try {
if (wantarray) {
- return $self->command('repo-config', '--get-all', $var);
+ return $self->command('config', '--get-all', $var);
} else {
- return $self->command_oneline('repo-config', '--get', $var);
+ return $self->command_oneline('config', '--get', $var);
}
} catch Git::Error::Command with {
my $E = shift;
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 0e4f32d5c9df518ded062085420ccdecf016488c..49b5666b33283feaf8ea2b7c09faeab8016c746d 100755 (executable)
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
# Copyright (c) 2005 Johannes Schindelin
#
-test_description='Test git-repo-config in different settings'
+test_description='Test git-config in different settings'
. ./test-lib.sh
test -f .git/config && rm .git/config
-git-repo-config core.penguin "little blue"
+git-config core.penguin "little blue"
cat > expect << EOF
[core]
test_expect_success 'initial' 'cmp .git/config expect'
-git-repo-config Core.Movie BadPhysics
+git-config Core.Movie BadPhysics
cat > expect << EOF
[core]
test_expect_success 'mixed case' 'cmp .git/config expect'
-git-repo-config Cores.WhatEver Second
+git-config Cores.WhatEver Second
cat > expect << EOF
[core]
test_expect_success 'similar section' 'cmp .git/config expect'
-git-repo-config CORE.UPPERCASE true
+git-config CORE.UPPERCASE true
cat > expect << EOF
[core]
test_expect_success 'similar section' 'cmp .git/config expect'
test_expect_success 'replace with non-match' \
- 'git-repo-config core.penguin kingpin !blue'
+ 'git-config core.penguin kingpin !blue'
test_expect_success 'replace with non-match (actually matching)' \
- 'git-repo-config core.penguin "very blue" !kingpin'
+ 'git-config core.penguin "very blue" !kingpin'
cat > expect << EOF
[core]
cp .git/config .git/config2
test_expect_success 'multiple unset' \
- 'git-repo-config --unset-all beta.haha'
+ 'git-config --unset-all beta.haha'
cat > expect << EOF
[beta] ; silly comment # another comment
mv .git/config2 .git/config
test_expect_success '--replace-all' \
- 'git-repo-config --replace-all beta.haha gamma'
+ 'git-config --replace-all beta.haha gamma'
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'all replaced' 'cmp .git/config expect'
-git-repo-config beta.haha alpha
+git-config beta.haha alpha
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'really mean test' 'cmp .git/config expect'
-git-repo-config nextsection.nonewline wow
+git-config nextsection.nonewline wow
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'really really mean test' 'cmp .git/config expect'
-test_expect_success 'get value' 'test alpha = $(git-repo-config beta.haha)'
-git-repo-config --unset beta.haha
+test_expect_success 'get value' 'test alpha = $(git-config beta.haha)'
+git-config --unset beta.haha
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'unset' 'cmp .git/config expect'
-git-repo-config nextsection.NoNewLine "wow2 for me" "for me$"
+git-config nextsection.NoNewLine "wow2 for me" "for me$"
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'multivar' 'cmp .git/config expect'
test_expect_success 'non-match' \
- 'git-repo-config --get nextsection.nonewline !for'
+ 'git-config --get nextsection.nonewline !for'
test_expect_success 'non-match value' \
- 'test wow = $(git-repo-config --get nextsection.nonewline !for)'
+ 'test wow = $(git-config --get nextsection.nonewline !for)'
test_expect_failure 'ambiguous get' \
- 'git-repo-config --get nextsection.nonewline'
+ 'git-config --get nextsection.nonewline'
test_expect_success 'get multivar' \
- 'git-repo-config --get-all nextsection.nonewline'
+ 'git-config --get-all nextsection.nonewline'
-git-repo-config nextsection.nonewline "wow3" "wow$"
+git-config nextsection.nonewline "wow3" "wow$"
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'multivar replace' 'cmp .git/config expect'
-test_expect_failure 'ambiguous value' 'git-repo-config nextsection.nonewline'
+test_expect_failure 'ambiguous value' 'git-config nextsection.nonewline'
test_expect_failure 'ambiguous unset' \
- 'git-repo-config --unset nextsection.nonewline'
+ 'git-config --unset nextsection.nonewline'
test_expect_failure 'invalid unset' \
- 'git-repo-config --unset somesection.nonewline'
+ 'git-config --unset somesection.nonewline'
-git-repo-config --unset nextsection.nonewline "wow3$"
+git-config --unset nextsection.nonewline "wow3$"
cat > expect << EOF
[beta] ; silly comment # another comment
test_expect_success 'multivar unset' 'cmp .git/config expect'
-test_expect_failure 'invalid key' 'git-repo-config inval.2key blabla'
+test_expect_failure 'invalid key' 'git-config inval.2key blabla'
-test_expect_success 'correct key' 'git-repo-config 123456.a123 987'
+test_expect_success 'correct key' 'git-config 123456.a123 987'
test_expect_success 'hierarchical section' \
- 'git-repo-config Version.1.2.3eX.Alpha beta'
+ 'git-config Version.1.2.3eX.Alpha beta'
cat > expect << EOF
[beta] ; silly comment # another comment
EOF
test_expect_success 'working --list' \
- 'git-repo-config --list > output && cmp output expect'
+ 'git-config --list > output && cmp output expect'
cat > expect << EOF
beta.noindent sillyValue
EOF
test_expect_success '--get-regexp' \
- 'git-repo-config --get-regexp in > output && cmp output expect'
+ 'git-config --get-regexp in > output && cmp output expect'
-git-repo-config --add nextsection.nonewline "wow4 for you"
+git-config --add nextsection.nonewline "wow4 for you"
cat > expect << EOF
wow2 for me
EOF
test_expect_success '--add' \
- 'git-repo-config --get-all nextsection.nonewline > output && cmp output expect'
+ 'git-config --get-all nextsection.nonewline > output && cmp output expect'
cat > .git/config << EOF
[novalue]
EOF
test_expect_success 'get variable with no value' \
- 'git-repo-config --get novalue.variable ^$'
+ 'git-config --get novalue.variable ^$'
-git-repo-config > output 2>&1
+git-config > output 2>&1
test_expect_success 'no arguments, but no crash' \
"test $? = 129 && grep usage output"
c = d
EOF
-git-repo-config a.x y
+git-config a.x y
cat > expect << EOF
[a.b]
test_expect_success 'new section is partial match of another' 'cmp .git/config expect'
-git-repo-config b.x y
-git-repo-config a.b c
+git-config b.x y
+git-config a.b c
cat > expect << EOF
[a.b]
ein.bahn=strasse
EOF
-GIT_CONFIG=other-config git-repo-config -l > output
+GIT_CONFIG=other-config git-config -l > output
test_expect_success 'alternative GIT_CONFIG' 'cmp output expect'
-GIT_CONFIG=other-config git-repo-config anwohner.park ausweis
+GIT_CONFIG=other-config git-config anwohner.park ausweis
cat > expect << EOF
[ein]
EOF
test_expect_success "rename section" \
- "git-repo-config --rename-section branch.eins branch.zwei"
+ "git-config --rename-section branch.eins branch.zwei"
cat > expect << EOF
# Hallo
test_expect_success "rename succeeded" "diff -u expect .git/config"
test_expect_failure "rename non-existing section" \
- 'git-repo-config --rename-section branch."world domination" branch.drei'
+ 'git-config --rename-section branch."world domination" branch.drei'
test_expect_success "rename succeeded" "diff -u expect .git/config"
test_expect_success "rename another section" \
- 'git-repo-config --rename-section branch."1 234 blabl/a" branch.drei'
+ 'git-config --rename-section branch."1 234 blabl/a" branch.drei'
cat > expect << EOF
# Hallo
test_expect_success numbers '
- git-repo-config kilo.gram 1k &&
- git-repo-config mega.ton 1m &&
- k=$(git-repo-config --int --get kilo.gram) &&
+ git-config kilo.gram 1k &&
+ git-config mega.ton 1m &&
+ k=$(git-config --int --get kilo.gram) &&
test z1024 = "z$k" &&
- m=$(git-repo-config --int --get mega.ton) &&
+ m=$(git-config --int --get mega.ton) &&
test z1048576 = "z$m"
'
rm .git/config
-git-repo-config quote.leading " test"
-git-repo-config quote.ending "test "
-git-repo-config quote.semicolon "test;test"
-git-repo-config quote.hash "test#test"
+git-config quote.leading " test"
+git-config quote.ending "test "
+git-config quote.semicolon "test;test"
+git-config quote.hash "test#test"
cat > expect << EOF
[quote]
test_expect_success 'quoting' 'cmp .git/config expect'
-test_expect_failure 'key with newline' 'git repo-config key.with\\\
+test_expect_failure 'key with newline' 'git config key.with\\\
newline 123'
-test_expect_success 'value with newline' 'git repo-config key.sub value.with\\\
+test_expect_success 'value with newline' 'git config key.sub value.with\\\
newline'
cat > .git/config <<\EOF
section.quotecont=cont;inued
EOF
-git repo-config --list > result
+git config --list > result
test_expect_success 'value continued on next line' 'cmp result expect'
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index e48e2b7189c5cd21cdef65eb7b93314f1c4b1909..d0aba2c2ae1fbd5f5282de1a0ee7ed8b87b80faa 100755 (executable)
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
test_expect_success \
'enable core.logAllRefUpdates' \
- 'git-repo-config core.logAllRefUpdates true &&
- test true = $(git-repo-config --bool --get core.logAllRefUpdates)'
+ 'git-config core.logAllRefUpdates true &&
+ test true = $(git-config --bool --get core.logAllRefUpdates)'
test_expect_success \
"create $m (logged by config)" \
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 8e8d526ef2e68fb8f50b9164f2ff032bafa104d6..47d124732cd04481d6a21e927aa6104f63e21fbf 100755 (executable)
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
check_fsck &&
chmod +x C &&
- ( test "`git repo-config --bool core.filemode`" != false ||
+ ( test "`git config --bool core.filemode`" != false ||
echo executable >>C ) &&
git add C &&
test_tick && git commit -m dragon &&
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index bb80e4286a7144e88aca9839c26b9fd99ff6cd4e..5565c27033ab89959f2a39dfa9abaea99e40432b 100755 (executable)
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
git-branch r &&
git-branch -m q r/q'
-git-repo-config branch.s/s.dummy Hello
+git-config branch.s/s.dummy Hello
test_expect_success \
'git branch -m s/s s should work when s/t is deleted' \
test -f .git/logs/refs/heads/s'
test_expect_success 'config information was renamed, too' \
- "test $(git-repo-config branch.s.dummy) = Hello &&
- ! git-repo-config branch.s/s/dummy"
+ "test $(git-config branch.s.dummy) = Hello &&
+ ! git-config branch.s/s/dummy"
test_expect_failure \
'git-branch -m u v should fail when the reflog for u is a symlink' \
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index e98786de32ca3139b2587fd5fca29a9f400c81d7..caaab26c2f3f2d04581a6c6918ab36f97a51f975 100755 (executable)
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
test_expect_success \
'git-add: Test that executable bit is not used if core.filemode=0' \
- 'git repo-config core.filemode 0 &&
+ 'git config core.filemode 0 &&
echo foo >xfoo1 &&
chmod 755 xfoo1 &&
git-add xfoo1 &&
test_expect_success \
'git-update-index --add: Test that executable bit is not used...' \
- 'git repo-config core.filemode 0 &&
+ 'git config core.filemode 0 &&
echo foo >xfoo2 &&
chmod 755 xfoo2 &&
git-update-index --add xfoo2 &&
test_expect_success \
'git-update-index --add: Test that executable bit is not used...' \
- 'git repo-config core.filemode 0 &&
+ 'git config core.filemode 0 &&
ln -s xfoo2 xfoo3 &&
git-update-index --add xfoo3 &&
case "`git-ls-files --stage xfoo3`" in
diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index 6714b0dd6e6164eb17174465be536ee3a07d88e1..e54fe0f4014d435f7d2da325bef3d7602a584d42 100755 (executable)
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
for H in ISO-8859-1 EUCJP ISO-2022-JP
do
test_expect_success "$H setup" '
- git-repo-config i18n.commitencoding $H &&
+ git-config i18n.commitencoding $H &&
git-checkout -b $H C0 &&
echo $H >F &&
git-commit -a -F ../t3900/$H.txt
'
done
-test_expect_success 'repo-config to remove customization' '
- git-repo-config --unset-all i18n.commitencoding &&
- if Z=$(git-repo-config --get-all i18n.commitencoding)
+test_expect_success 'config to remove customization' '
+ git-config --unset-all i18n.commitencoding &&
+ if Z=$(git-config --get-all i18n.commitencoding)
then
echo Oops, should have failed.
false
else
test z = "z$Z"
fi &&
- git-repo-config i18n.commitencoding utf-8
+ git-config i18n.commitencoding utf-8
'
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
'
done
-test_expect_success 'repo-config to add customization' '
- git-repo-config --unset-all i18n.commitencoding &&
- if Z=$(git-repo-config --get-all i18n.commitencoding)
+test_expect_success 'config to add customization' '
+ git-config --unset-all i18n.commitencoding &&
+ if Z=$(git-config --get-all i18n.commitencoding)
then
echo Oops, should have failed.
false
for H in ISO-8859-1 EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in itself now" '
- git-repo-config i18n.commitencoding '$H' &&
+ git-config i18n.commitencoding '$H' &&
compare_with '$H' ../t3900/'$H'.txt
'
done
-test_expect_success 'repo-config to tweak customization' '
- git-repo-config i18n.logoutputencoding utf-8
+test_expect_success 'config to tweak customization' '
+ git-config i18n.logoutputencoding utf-8
'
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
for J in EUCJP ISO-2022-JP
do
- git-repo-config i18n.logoutputencoding $J
+ git-config i18n.logoutputencoding $J
for H in EUCJP ISO-2022-JP
do
test_expect_success "$H should be shown in $J now" '
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index eda0e2d72950d72813dc6133a00bbd6391796d0a..a881797bc7b6679f2328405adc450a7840061896 100755 (executable)
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
}
test_expect_success setup '
- git-repo-config i18n.commitencoding UTF-8 &&
+ git-config i18n.commitencoding UTF-8 &&
# use UTF-8 in author and committer name to match the
# i18n.commitencoding settings
git commit -s -m "Second on side" &&
# the second one on the side branch is ISO-8859-1
- git-repo-config i18n.commitencoding ISO-8859-1 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
# use author and committer name in ISO-8859-1 to match it.
. ../t3901-8859-1.txt &&
test_tick &&
git commit -s -m "Third on side" &&
# Back to default
- git-repo-config i18n.commitencoding UTF-8
+ git-config i18n.commitencoding UTF-8
'
test_expect_success 'format-patch output (ISO-8859-1)' '
- git-repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.logoutputencoding ISO-8859-1 &&
git format-patch --stdout master..HEAD^ >out-l1 &&
git format-patch --stdout HEAD^ >out-l2 &&
'
test_expect_success 'format-patch output (UTF-8)' '
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git config i18n.logoutputencoding UTF-8 &&
git format-patch --stdout master..HEAD^ >out-u1 &&
git format-patch --stdout HEAD^ >out-u2 &&
test_expect_success 'rebase (U/U)' '
# We want the result of rebase in UTF-8
- git-repo-config i18n.commitencoding UTF-8 &&
+ git-config i18n.commitencoding UTF-8 &&
# The test is about logoutputencoding not affecting the
# final outcome -- it is used internally to generate the
# patch and the log.
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git config i18n.logoutputencoding UTF-8 &&
# The result will be committed by GIT_COMMITTER_NAME --
# we want UTF-8 encoded name.
'
test_expect_success 'rebase (U/L)' '
- git-repo-config i18n.commitencoding UTF-8 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding UTF-8 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-utf8.txt &&
git reset --hard side &&
test_expect_success 'rebase (L/L)' '
# In this test we want ISO-8859-1 encoded commits as the result
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-8859-1.txt &&
git reset --hard side &&
test_expect_success 'rebase (L/U)' '
# This is pathological -- use UTF-8 as intermediate form
# to get ISO-8859-1 results.
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding UTF-8 &&
. ../t3901-8859-1.txt &&
git reset --hard side &&
test_expect_success 'cherry-pick(U/U)' '
# Both the commitencoding and logoutputencoding is set to UTF-8.
- git-repo-config i18n.commitencoding UTF-8 &&
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git-config i18n.commitencoding UTF-8 &&
+ git config i18n.logoutputencoding UTF-8 &&
. ../t3901-utf8.txt &&
git reset --hard master &&
test_expect_success 'cherry-pick(L/L)' '
# Both the commitencoding and logoutputencoding is set to ISO-8859-1
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-8859-1.txt &&
git reset --hard master &&
test_expect_success 'cherry-pick(U/L)' '
# Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1
- git-repo-config i18n.commitencoding UTF-8 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding UTF-8 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-utf8.txt &&
git reset --hard master &&
# Again, the commitencoding is set to ISO-8859-1 but
# logoutputencoding is set to UTF-8.
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding UTF-8 &&
. ../t3901-8859-1.txt &&
git reset --hard master &&
'
test_expect_success 'rebase --merge (U/U)' '
- git-repo-config i18n.commitencoding UTF-8 &&
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git-config i18n.commitencoding UTF-8 &&
+ git config i18n.logoutputencoding UTF-8 &&
. ../t3901-utf8.txt &&
git reset --hard side &&
'
test_expect_success 'rebase --merge (U/L)' '
- git-repo-config i18n.commitencoding UTF-8 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding UTF-8 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-utf8.txt &&
git reset --hard side &&
test_expect_success 'rebase --merge (L/L)' '
# In this test we want ISO-8859-1 encoded commits as the result
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding ISO-8859-1 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding ISO-8859-1 &&
. ../t3901-8859-1.txt &&
git reset --hard side &&
test_expect_success 'rebase --merge (L/U)' '
# This is pathological -- use UTF-8 as intermediate form
# to get ISO-8859-1 results.
- git-repo-config i18n.commitencoding ISO-8859-1 &&
- git repo-config i18n.logoutputencoding UTF-8 &&
+ git-config i18n.commitencoding ISO-8859-1 &&
+ git config i18n.logoutputencoding UTF-8 &&
. ../t3901-8859-1.txt &&
git reset --hard side &&
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index 67b9681d36e187a5717acbf9fe00a7f5dfd5bb65..9c58d77cc22a062e571116e2dee2599ac13cb464 100755 (executable)
--- a/t/t4000-diff-format.sh
+++ b/t/t4000-diff-format.sh
'git-diff-files -p >current'
# that's as far as it comes
-if [ "$(git repo-config --get core.filemode)" = false ]
+if [ "$(git config --get core.filemode)" = false ]
then
say 'filemode disabled on the filesystem'
test_done
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index 8ad69d11155f3a3df9a5508a07ccd78ba7e5d747..ca342f48a198c2e98e4459273e8350bb7aed6328 100755 (executable)
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
tree=`git-write-tree` &&
echo $tree'
-if [ "$(git repo-config --get core.filemode)" = false ]
+if [ "$(git config --get core.filemode)" = false ]
then
say 'filemode disabled on the filesystem, using update-index --chmod=+x'
test_expect_success \
index ed37141b6e5afd8294c5961a1ab96c634a5f4a82..3d85ceaae9e695d7b03d09cb082f1eef4f8406f2 100755 (executable)
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
for i in 1 2; do echo $i; done >>dir/sub &&
git update-index file0 dir/sub &&
- git repo-config log.showroot false &&
+ git config log.showroot false &&
git commit --amend &&
git show-branch
'
index 22da6a00ccbe910d796dc84666caa2acfa9b8389..b4662b03647bd2f36c07ffac24adc6b5df5eef76 100755 (executable)
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
test_expect_success apply \
'git-apply --index --stat --summary --apply test-patch'
-if [ "$(git repo-config --get core.filemode)" = false ]
+if [ "$(git config --get core.filemode)" = false ]
then
say 'filemode disabled on the filesystem'
else
index 5a7232a577fdf8f1da1e71b8679a132d2bc199b9..a6dbb04a86c06cabb22810822dd0f079c9268dd7 100755 (executable)
test_expect_success \
'verify-pack -v, packedGitWindowSize == 1 page' \
- 'git-repo-config core.packedGitWindowSize 512 &&
+ 'git-config core.packedGitWindowSize 512 &&
git-verify-pack -v "$pack1"'
test_expect_success \
'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \
- 'git-repo-config core.packedGitWindowSize 512 &&
- git-repo-config core.packedGitLimit 512 &&
+ 'git-config core.packedGitWindowSize 512 &&
+ git-config core.packedGitLimit 512 &&
git-verify-pack -v "$pack1"'
test_expect_success \
'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \
- 'git-repo-config core.packedGitWindowSize 512 &&
- git-repo-config core.packedGitLimit 512 &&
+ 'git-config core.packedGitWindowSize 512 &&
+ git-config core.packedGitLimit 512 &&
commit2=`git-commit-tree $tree -p $commit1 </dev/null` &&
git-update-ref HEAD $commit2 &&
git-repack -a -d &&
test_expect_success \
'verify-pack -v, defaults' \
- 'git-repo-config --unset core.packedGitWindowSize &&
- git-repo-config --unset core.packedGitLimit &&
+ 'git-config --unset core.packedGitWindowSize &&
+ git-config --unset core.packedGitLimit &&
git-verify-pack -v "$pack2"'
test_done
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 2c151912a3bcf2c91cfafcbc22f11bc71fedd34d..7d93d0d7c90de94b0972d8fa5cd6d747c3fd2f56 100755 (executable)
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
test_expect_success \
'pushing with --force should be denied with denyNonFastforwards' '
cd victim &&
- git-repo-config receive.denyNonFastforwards true &&
+ git-config receive.denyNonFastforwards true &&
cd .. &&
git-update-ref refs/heads/master master^ &&
git-send-pack --force ./victim/.git/ master &&
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 058cce0775c3fdc98e6c0e70c99ce387affd699c..e35d60fa3ab9d7694f89f4451caf741003feeb13 100755 (executable)
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
mkdir client &&
cd client &&
git-init 2>> log2.txt &&
- git repo-config transfer.unpacklimit 0
+ git config transfer.unpacklimit 0
)
add A1
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 3ce9446210bc56443e7a39273699983c1d9a65a4..50c64856f0fd35fd14007e0603a1cf58ce702cec 100755 (executable)
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
cd .. &&
git clone . two &&
cd two &&
- git repo-config branch.master.remote one &&
- git repo-config remote.one.url ../one/.git/ &&
- git repo-config remote.one.fetch refs/heads/master:refs/heads/one &&
+ git config branch.master.remote one &&
+ git config remote.one.url ../one/.git/ &&
+ git config remote.one.fetch refs/heads/master:refs/heads/one &&
cd .. &&
git clone . three &&
cd three &&
- git repo-config branch.master.remote two &&
- git repo-config branch.master.merge refs/heads/one &&
+ git config branch.master.remote two &&
+ git config branch.master.merge refs/heads/one &&
mkdir -p .git/remotes &&
{
echo "URL: ../two/.git/"
index 63e49f310cdc0bf99cb1578c29f2a3da4059da75..ea140236162894ed2e5691b57ba8c5cf98e5627d 100755 (executable)
--- a/t/t6200-fmt-merge-msg.sh
+++ b/t/t6200-fmt-merge-msg.sh
test_expect_success 'merge-msg test #3' '
- git repo-config merge.summary true &&
+ git config merge.summary true &&
git checkout master &&
setdate &&
test_expect_success 'merge-msg test #4' '
- git repo-config merge.summary true &&
+ git config merge.summary true &&
git checkout master &&
setdate &&
test_expect_success 'merge-msg test #5' '
- git repo-config merge.summary yes &&
+ git config merge.summary yes &&
git checkout master &&
setdate &&