git user's manual
Subsystems (2)
I'm still tinkering with this "Git User's Manual"; you can see the current draft at:
http://fieldses.org/~bfields/git-user-manual.html
or get the source from the branch master in:
git://linux-nfs.org/~bfields/git.git
Changes include:
- a "quick start" with a bunch of commands and no explanation, as the first chapter
- discussion of git-remote, presenting that as the primary method for tracking remotes and postponing fetches of individual branches till later. (Is this a sensible approach?)
- import of a slightly modified version of the README as the start of a "git internals' chapter.
- discussion of history rewriting, pitfalls thereof, cherry-pick, rebase, etc.
- updates to try to track recent interface improvements, etc.
So it's longer, but still incomplete, and some of it's probably quite wrong....
Despite that I'm tempted to ask that it be merged some time soon and just not referred to much yet; then hopefully people could help bludgeon it into shape before we start adding pointers to it from elsewhere.
Then we'll have to figure out whether it could obsolete any existing documentation. I'd kind of like to rip out tutorial-2.txt at least, and maybe absorb cvs-migration and a few other things as new chapters.
I dunno; thoughts?
--b.
PATCH 1/1 user-manual: set user.name and user.email with repo-config
---
There are some other places where direct editing of .git/config is suggested. I'd rather tell the user to use repo-config and add a note that repo-config saves the configuration to .git/config (or ~/.gitconfig with --global) which can be edited by hand too. cat .git/config to show the remote configuration can be replaced by git-repo-config -l | grep '^remote\.'
--- Documentation/user-manual.txt | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
Documentation/user-manual.txt +2 -5
@@ -153,11 +153,8 @@ Making changes Make sure git knows who to blame: ------------------------------------------------ -$ cat >~/.gitconfig <<\EOF -[user] -name = Your Name Comes Here -email = [email protected] -EOF +$ git repo-config --global user.name "Your Name Comes Here" +$ git repo-config --global user.email [email protected] ------------------------------------------------ Select file contents to include in the next commit, then make the
Signature · 1 line
1.5.0.rc2.g18af
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 8 lines · Matthias Lederhofer
---
There are some other places where direct editing of .git/config is suggested. I'd rather tell the user to use repo-config and add a note that repo-config saves the configuration to .git/config (or ~/.gitconfig with --global) which can be edited by hand too. cat .git/config to show the remote configuration can be replaced by git-repo-config -l | grep '^remote\.'
---
Based on the followup I think what makes sense is to continue with some mixture of the two approaches--mainly editing the configuration file directly, but providing frequent references to the git-repo-config/git-config manpage so people know where to find the details.
I've added a few more references to the manpage, along with a few other updates, including an initial import of Linus's discussion of dangling objects, and brief dicussions of reflogs, fsck, and pruning:
git://linux-nfs.org/~bfields/git.git master
http://www.fieldses.org/~bfields/git-user-manual.html
--b.
Re: [PATCH] user-manual: set user.name and user.email with repo-config
In reply to Matthias LederhoferQuoted 7 lines · Matthias Lederhofer
There are some other places where direct editing of .git/config is suggested. I'd rather tell the user to use repo-config and add a note that repo-config saves the configuration to .git/config (or ~/.gitconfig with --global) which can be edited by hand too. cat .git/config to show the remote configuration can be replaced by git-repo-config -l | grep '^remote\.'
I dunno. I really think that editing the config file is actually simpler.
The "git repo-config" thing is really usefull from scripting, and for general automation, but maybe it's just me - I find human-readable ASCII files that you can put comments in etc just *nice*.
I think the whole notion that you have to use a tool to edit configurations is asinine. It's good to have a tool for automation, but it's bad if that's the only way to interact with the system.
The first time I had to use AIX, and realized that they do everything with some crazy system management tool, and that you can't do anything by editing files in /etc, I realized that IBM was totally incompetent when it came to UNIX.
I mean, do people _really_ think that it's easier to do black magic scripts like
git repo-config --global user.name "Your Name Comes Here"
(which not only looks scary, but means that the user will never learn about the git config file at all), or just somebody saying:
"Fill your .git/config file with
[user]
name = Your Name Here email = [email protected]
and be happy"
I'm just saying that the second example seems to not only be more human-friendly, it actually teaches people something that "git repo-config" never did.
Maybe most users will just do what they are told without thinking about it, but then some users will look at that and say "Ahh, there's a .git/config file, I wonder what else I could do there.."
Linus
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 31 lines · Linus Torvalds
I dunno. I really think that editing the config file is actually simpler.
The "git repo-config" thing is really usefull from scripting, and for general automation, but maybe it's just me - I find human-readable ASCII files that you can put comments in etc just *nice*.
I think the whole notion that you have to use a tool to edit configurations is asinine. It's good to have a tool for automation, but it's bad if that's the only way to interact with the system.
The first time I had to use AIX, and realized that they do everything with some crazy system management tool, and that you can't do anything by editing files in /etc, I realized that IBM was totally incompetent when it came to UNIX.
I mean, do people _really_ think that it's easier to do black magic scripts like
git repo-config --global user.name "Your Name Comes Here"
(which not only looks scary, but means that the user will never learn about the git config file at all), or just somebody saying:
"Fill your .git/config file with
[user]
name = Your Name Here email = [email protected]and be happy"
Quoted 7 lines
I'm just saying that the second example seems to not only be more human-friendly, it actually teaches people something that "git repo-config" never did.
Maybe most users will just do what they are told without thinking about it, but then some users will look at that and say "Ahh, there's a .git/config file, I wonder what else I could do there.."
Good point, otoh the git-repo-config manual page is actually the one documenting .git/config :). Therefore I think the manual should mention git-repo-config(1) for information on .git/config with the first use of the config file (actually the second because the first is in part 1 which is only a list of commands).
Later in the manual git-repo-config is used to read (-l) and edit the config file, perhaps there should be a short sentence that there is no difference to editing .git/config directly.
---
user-manual: mention git-repo-config(1) with .git/config
--- Documentation/user-manual.txt | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Documentation/user-manual.txt +2 -1
@@ -603,7 +603,8 @@ $ cat .git/config This is what causes git to track the remote's branches; you may modify or delete these configuration options by editing .git/config -with a text editor. +with a text editor. See gitlink:git-repo-config[1] for more +information on .git/config. Exploring git history =====================
Signature · 1 line
1.5.0.rc2.g18af
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 3 lines · Matthias Lederhofer
Good point, otoh the git-repo-config manual page is actually the one documenting .git/config :).
Btw, one thing I don't like about "git-repo-config" is the name.
Many people thought "git init-db" was confusing, and now we call it just "git init".
Can I vote for doing that for "git repo-config" too? Is there something wrong with just calling it "git config"?
Especially as it's not even repo-specific. Use "--global", and it has almost nothing at all to do with the particular "repo" you're working with.
What would also mean that we'd have the man-page with a simple
man git-config
which makes tons of sense if it documents both the config file *and* the "git config" program.
Or is that too sneaky?
Linus
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 14 lines · Linus Torvalds
Btw, one thing I don't like about "git-repo-config" is the name.
Many people thought "git init-db" was confusing, and now we call it just "git init".
Can I vote for doing that for "git repo-config" too? Is there something wrong with just calling it "git config"?
Especially as it's not even repo-specific. Use "--global", and it has almost nothing at all to do with the particular "repo" you're working with.
What would also mean that we'd have the man-page with a simple
Quoted 8 lines
man git-config
which makes tons of sense if it documents both the config file *and* the "git config" program.
Or is that too sneaky?
Linus
--- .gitignore | 1 + Documentation/cmd-list.perl | 2 +- Documentation/config.txt | 2 +- Documentation/core-tutorial.txt | 2 +- Documentation/cvs-migration.txt | 2 +- Documentation/everyday.txt | 4 +- Documentation/git-config.txt | 227 ++++++++++++++++++++ Documentation/git-pull.txt | 4 +- Documentation/git-remote.txt | 4 +- Documentation/git-repo-config.txt | 227 -------------------- Documentation/git-svn.txt | 20 +- Documentation/git-update-index.txt | 4 +- Documentation/git-var.txt | 4 +- Documentation/git.txt | 2 +- Documentation/howto/setup-git-server-over-http.txt | 4 +- Documentation/tutorial.txt | 8 +- Makefile | 4 +- builtin-config.c | 220 +++++++++++++++++++ builtin-repo-config.c | 220 ------------------- builtin.h | 2 +- contrib/completion/git-completion.bash | 15 +- contrib/emacs/git.el | 8 +- contrib/gitview/gitview | 2 +- contrib/remotes2config.sh | 4 +- git-clone.sh | 10 +- git-commit.sh | 4 +- git-cvsserver.perl | 6 +- git-fetch.sh | 2 +- git-instaweb.sh | 10 +- git-ls-remote.sh | 2 +- git-merge.sh | 4 +- git-p4import.py | 4 +- git-parse-remote.sh | 14 +- git-remote.perl | 8 +- git-repack.sh | 2 +- git-revert.sh | 2 +- git-sh-setup.sh | 2 +- git-svn.perl | 20 +- git.c | 3 +- gitk | 2 +- gitweb/gitweb.perl | 2 +- ident.c | 4 +- perl/Git.pm | 8 +- t/t1300-repo-config.sh | 102 +++++----- t/t1400-update-ref.sh | 4 +- t/t1410-reflog.sh | 2 +- t/t3200-branch.sh | 6 +- t/t3700-add.sh | 6 +- t/t3900-i18n-commit.sh | 24 +- t/t3901-i18n-patch.sh | 58 +++--- t/t4000-diff-format.sh | 2 +- t/t4006-diff-mode.sh | 2 +- t/t4013-diff-various.sh | 2 +- t/t4102-apply-rename.sh | 2 +- t/t5301-sliding-window.sh | 14 +- t/t5400-send-pack.sh | 2 +- t/t5500-fetch-pack.sh | 2 +- t/t5510-fetch.sh | 10 +- t/t6200-fmt-merge-msg.sh | 6 +- 59 files changed, 674 insertions(+), 671 deletions(-) create mode 100644 Documentation/git-config.txt delete mode 100644 Documentation/git-repo-config.txt create mode 100644 builtin-config.c delete mode 100644 builtin-repo-config.c
.gitignore +1 -0
@@ -23,6 +23,7 @@ git-clean git-clone git-commit git-commit-tree +git-config git-convert-objects git-count-objects git-cvsexportcommit
Documentation/cmd-list.perl +1 -1
@@ -144,7 +144,7 @@ git-receive-pack synchelpers 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
Documentation/config.txt +1 -1
@@ -62,7 +62,7 @@ The values following the equals sign in variable assign are all either 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
Documentation/core-tutorial.txt +1 -1
@@ -1130,7 +1130,7 @@ the remote repository URL in the local repository's config 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.
Documentation/cvs-migration.txt +1 -1
@@ -36,7 +36,7 @@ them first before running git pull. ================================ 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. ================================
Documentation/everyday.txt +2 -2
@@ -212,12 +212,12 @@ Push into another repository.:: ------------ 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>
Documentation/git-config.txt new file +227 -0
227 lines not on this page · raw message
Documentation/git-pull.txt +2 -2
@@ -42,7 +42,7 @@ git pull, git pull origin:: 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::
@@ -94,7 +94,7 @@ gitlink:git-reset[1]. 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
Documentation/git-remote.txt +2 -2
@@ -28,7 +28,7 @@ In the third form, gives some information about the remote <name>. 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 --------
@@ -58,7 +58,7 @@ See Also -------- gitlink:git-fetch[1] gitlink:git-branch[1] -gitlink:git-repo-config[1] +gitlink:git-config[1] Author ------
Documentation/git-repo-config.txt deleted +0 -227
227 lines not on this page · raw message
Documentation/git-svn.txt +10 -10
@@ -204,7 +204,7 @@ removed by default if there are no files left in them. git 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::
@@ -215,7 +215,7 @@ Edit the commit message before committing to SVN. This is off by 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::
@@ -226,8 +226,8 @@ They are both passed directly to git-diff-tree see 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>::
@@ -245,7 +245,7 @@ will abort operation. The user will then have to add the 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::
@@ -262,8 +262,8 @@ repo-config key: svn.authorsfile --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::
@@ -304,7 +304,7 @@ used to track branches across multiple SVN _repositories_. 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>::
@@ -320,7 +320,7 @@ for more information on using 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.
@@ -332,7 +332,7 @@ repo-config key: svn.followparent The 'git-svn log' command will not work on repositories using this, either. -repo-config key: svn.nometadata +config key: svn.nometadata --
Documentation/git-update-index.txt +2 -2
@@ -289,7 +289,7 @@ Configuration 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
@@ -301,7 +301,7 @@ The command looks at `core.ignorestat` configuration variable. See See Also -------- -gitlink:git-repo-config[1] +gitlink:git-config[1] Author
Documentation/git-var.txt +2 -2
@@ -20,7 +20,7 @@ OPTIONS 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 --------
@@ -49,7 +49,7 @@ See Also -------- gitlink:git-commit-tree[1] gitlink:git-tag[1] -gitlink:git-repo-config[1] +gitlink:git-config[1] Author ------
Documentation/git.txt +1 -1
@@ -24,7 +24,7 @@ link:everyday.html[Everyday Git] for a useful minimum set of commands, and 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 -------
Documentation/howto/setup-git-server-over-http.txt +2 -2
@@ -205,7 +205,7 @@ To check whether all is OK, do: 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
@@ -222,7 +222,7 @@ From your client repository, do 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:
Documentation/tutorial.txt +4 -4
@@ -16,8 +16,8 @@ public email address before doing any operation. The easiest way to do so is: ------------------------------------------------ -$ git repo-config --global user.name "Your Name Comes Here" -$ git repo-config --global user.email [email protected] +$ git config --global user.name "Your Name Comes Here" +$ git config --global user.email [email protected] ------------------------------------------------
@@ -353,12 +353,12 @@ repository in the repository configuration, and that location is 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
Makefile +2 -2
@@ -213,7 +213,7 @@ EXTRA_PROGRAMS = 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
@@ -299,7 +299,7 @@ BUILTIN_OBJS = \ 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 \
builtin-config.c new file +220 -0
220 lines not on this page · raw message
builtin-repo-config.c deleted +0 -220
220 lines not on this page · raw message
builtin.h +1 -1
@@ -53,7 +53,7 @@ extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);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);
contrib/completion/git-completion.bash +8 -7
@@ -145,7 +145,7 @@ __git_remotes () 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.}"
@@ -286,7 +286,7 @@ __git_commandlist="$(__git_commands 2>/dev/null)" __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.}"
@@ -299,7 +299,7 @@ __git_aliases () __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
@@ -629,7 +629,7 @@ _git_rebase () COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur")) } -_git_repo_config () +_git_config () { local cur="${COMP_WORDS[COMP_CWORD]}" local prv="${COMP_WORDS[COMP_CWORD-1]}"
@@ -806,6 +806,7 @@ _git () 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 ;;
@@ -819,7 +820,7 @@ _git () 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 ;;
@@ -856,7 +857,7 @@ complete -o default -F _git_name_rev git-name-rev 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
@@ -879,7 +880,7 @@ complete -o default -o nospace -F _git_ls_tree git-ls-tree.exe 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
contrib/emacs/git.el +4 -4
@@ -222,7 +222,7 @@ and returns the process output as a string." "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)))
@@ -231,7 +231,7 @@ and returns the process output as a string." "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)))
@@ -298,9 +298,9 @@ and returns the process output as a string." (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)
contrib/gitview/gitview +1 -1
@@ -497,7 +497,7 @@ class 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 == ""):
contrib/remotes2config.sh +2 -2
@@ -26,8 +26,8 @@ if [ -d "$GIT_DIR"/remotes ]; then 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
git-clone.sh +5 -5
@@ -36,7 +36,7 @@ clone_dumb_http () { 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" ||
@@ -386,17 +386,17 @@ then 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
git-commit.sh +2 -2
@@ -429,7 +429,7 @@ then 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"
@@ -485,7 +485,7 @@ then 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"
git-cvsserver.perl +3 -3
@@ -172,11 +172,11 @@ sub req_Root 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 )
git-fetch.sh +1 -1
@@ -321,7 +321,7 @@ fetch_main () { 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
git-instaweb.sh +5 -5
@@ -15,11 +15,11 @@ case "$GIT_DIR" in 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
git-ls-remote.sh +1 -1
@@ -58,7 +58,7 @@ http://* | https://* | ftp://* ) 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" ||
git-merge.sh +2 -2
@@ -233,7 +233,7 @@ case "$use_strategies" in '') case "$#" in 1) - var="`git-repo-config --get pull.twohead`" + var="`git-config --get pull.twohead`" if test -n "$var" then use_strategies="$var"
@@ -241,7 +241,7 @@ case "$use_strategies" in 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"
git-p4import.py +2 -2
@@ -193,13 +193,13 @@ class git_command: 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)
git-parse-remote.sh +7 -7
@@ -10,7 +10,7 @@ get_data_source () { 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"
@@ -32,7 +32,7 @@ get_remote_url () { echo "$1" ;; config) - git-repo-config --get "remote.$1.url" + git-config --get "remote.$1.url" ;; remotes) sed -ne '/^URL: */{
@@ -50,7 +50,7 @@ get_remote_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} }
@@ -60,7 +60,7 @@ get_remote_default_refs_for_push () { '' | 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
@@ -139,7 +139,7 @@ canon_refs_list_for_fetch () { 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
@@ -205,7 +205,7 @@ get_remote_default_refs_for_fetch () { 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
@@ -284,7 +284,7 @@ get_uploadpack () { 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} ;; *)
git-remote.perl +4 -4
@@ -64,7 +64,7 @@ sub list_remote { 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+(.*)$/) {
@@ -103,7 +103,7 @@ sub list_branch { 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+(.*)$/) {
@@ -238,8 +238,8 @@ sub add_remote { 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/*"); }
git-repack.sh +1 -1
@@ -28,7 +28,7 @@ done # 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" ;;
git-revert.sh +1 -1
@@ -81,7 +81,7 @@ prev=$(git-rev-parse --verify "$commit^1" 2>/dev/null) || 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"
git-sh-setup.sh +1 -1
@@ -29,7 +29,7 @@ set_reflog_action() { } 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 ;;
git-svn.perl +10 -10
@@ -593,7 +593,7 @@ sub multi_init { "$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;
@@ -772,22 +772,22 @@ sub log_use_color { 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'; }
@@ -800,7 +800,7 @@ sub log_use_color { } 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'); }
@@ -919,7 +919,7 @@ sub complete_url_ls_init { 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 {
@@ -1594,7 +1594,7 @@ sub init_vars { %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;
@@ -1602,7 +1602,7 @@ sub read_repo_config { 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') {
git.c +2 -1
@@ -224,6 +224,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "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 },
@@ -254,7 +255,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "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 },
gitk +1 -1
@@ -6193,7 +6193,7 @@ set wrcomcmd "git diff-tree --stdin -p --pretty" 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"
gitweb/gitweb.perl +1 -1
@@ -986,7 +986,7 @@ sub git_get_project_config { $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";
ident.c +2 -2
@@ -160,8 +160,8 @@ static const char *env_hint ="\n" "Run\n" "\n" -" git repo-config user.email \"[email protected]\"\n" -" git repo-config user.name \"Your Name\"\n" +" git config user.email \"[email protected]\"\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"
perl/Git.pm +4 -4
@@ -482,14 +482,14 @@ sub wc_chdir { =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
@@ -500,9 +500,9 @@ sub config { 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;
t/t1300-repo-config.sh +51 -51
297 lines not on this page · raw message
t/t1400-update-ref.sh +2 -2
@@ -93,8 +93,8 @@ rm -rf .git/$m .git/logs expect 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)" \
t/t1410-reflog.sh +1 -1
@@ -71,7 +71,7 @@ test_expect_success setup ' 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 &&
t/t3200-branch.sh +3 -3
@@ -94,7 +94,7 @@ test_expect_failure \ 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' \
@@ -107,8 +107,8 @@ test_expect_success \ 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' \
t/t3700-add.sh +3 -3
@@ -21,7 +21,7 @@ test_expect_success \ 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 &&
@@ -32,7 +32,7 @@ test_expect_success \ 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 &&
@@ -43,7 +43,7 @@ test_expect_success \ 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
t/t3900-i18n-commit.sh +12 -12
@@ -29,7 +29,7 @@ test_expect_success 'no encoding header for base case' ' 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
@@ -44,16 +44,16 @@ do ' 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' '
@@ -67,9 +67,9 @@ do ' 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
@@ -81,13 +81,13 @@ test_expect_success 'repo-config to add customization' ' 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' '
@@ -103,7 +103,7 @@ done 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" '
t/t3901-i18n-patch.sh +29 -29
162 lines not on this page · raw message
t/t4000-diff-format.sh +1 -1
@@ -28,7 +28,7 @@ test_expect_success \ '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
t/t4006-diff-mode.sh +1 -1
@@ -15,7 +15,7 @@ test_expect_success \ 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 \
t/t4013-diff-various.sh +1 -1
@@ -73,7 +73,7 @@ test_expect_success setup ' 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 '
t/t4102-apply-rename.sh +1 -1
@@ -31,7 +31,7 @@ test_expect_success setup \ 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
t/t5301-sliding-window.sh +7 -7
@@ -30,19 +30,19 @@ test_expect_success \ 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 &&
@@ -53,8 +53,8 @@ test_expect_success \ 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
t/t5400-send-pack.sh +1 -1
@@ -106,7 +106,7 @@ export HOME ;# this way we force the victim/.git/config to be used. 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 &&
t/t5500-fetch-pack.sh +1 -1
@@ -98,7 +98,7 @@ pull_to_client () { mkdir client && cd client && git-init 2>> log2.txt && - git repo-config transfer.unpacklimit 0 + git config transfer.unpacklimit 0 ) add A1
t/t5510-fetch.sh +5 -5
@@ -22,14 +22,14 @@ test_expect_success "clone and setup child repos" ' 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/"
t/t6200-fmt-merge-msg.sh +3 -3
@@ -108,7 +108,7 @@ EOF test_expect_success 'merge-msg test #3' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate &&
@@ -138,7 +138,7 @@ EOF test_expect_success 'merge-msg test #4' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate &&
@@ -150,7 +150,7 @@ test_expect_success 'merge-msg test #4' ' test_expect_success 'merge-msg test #5' ' - git repo-config merge.summary yes && + git config merge.summary yes && git checkout master && setdate &&
Signature · 1 line
1.5.0.rc2.g5355
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Please, do not break people's scripts that still use repo-config.
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 2 lines · Junio C Hamano
Please, do not break people's scripts that still use repo-config.
Sorry for being terse. What I would prefer is no change to C files except what is minimally needed to adding 'git-config' as an alias to 'git-repo-config', plus s/repo-config/config/g in the Documentation.
For Porcelains and test scripts shipped with git, replace 'repo-config' to 'config' only for actual strings used as command names to be invoked, to play it safe (renaming a variable 'repo_config' to 'config' needs to be done and verified carefully as there may already be an existing variable 'config', for example).
Re: [PATCH] user-manual: set user.name and user.email with repo-config
In reply to Linus TorvaldsQuoted 7 lines · Linus Torvalds
Quoted 3 lines · Matthias Lederhofer
Good point, otoh the git-repo-config manual page is actually the one documenting .git/config :).
Quoted 7 lines
Btw, one thing I don't like about "git-repo-config" is the name.
Many people thought "git init-db" was confusing, and now we call it just "git init".
Can I vote for doing that for "git repo-config" too? Is there something wrong with just calling it "git config"?
While we're at it, is there any need for the "objects" in git-fsck-objects?
--b.
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 3 lines · J. Bruce Fields
While we're at it, is there any need for the "objects" in git-fsck-objects?
Not really. We should probably just add that alias too.
Linus
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 6 lines · Linus Torvalds
Quoted 3 lines · J. Bruce Fields
While we're at it, is there any need for the "objects" in git-fsck-objects?
Not really. We should probably just add that alias too.
Done.
PATCH 1/1 Make fsck and fsck-objects be builtins.
The earlier change df391b192 to rename fsck-objects to fsck broke fsck-objects. This should fix it again.
--- Makefile | 1 + fsck.c => builtin-fsck.c | 3 +-- builtin.h | 1 + git.c | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) rename fsck.c => builtin-fsck.c (100%)
Without this, I get
[metalzone ~/src/git]git fsck-objects
fatal: cannot handle fsck-objects internally
which isn't really very helpful. I thought about hacking the makefile to manufacture a hardlink from git-fsck-objects, but this just seemed so much easier. And we are slowly accumulating builtins, right? ;-)
Makefile +1 -0
@@ -284,6 +284,7 @@ BUILTIN_OBJS = \ builtin-diff-tree.o \ builtin-fmt-merge-msg.o \ builtin-for-each-ref.o \ + builtin-fsck.o \ builtin-grep.o \ builtin-init-db.o \ builtin-log.o \
builtin-fsck.c renamed from fsck.c +1 -2
@@ -571,12 +571,11 @@ static int fsck_cache_tree(struct cache_tree *it)return err; } -int main (int argc,char **argv) +int cmd_fsck (int argc,char **argv,const char *prefix) {int i, heads; track_object_refs =1 ; -setup_git_directory ();for (i =1 ; i < argc; i++) {const char *arg = argv[i];
builtin.h +1 -0
@@ -34,6 +34,7 @@ extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);extern int cmd_fmt_merge_msg (int argc,const char **argv,const char *prefix);extern int cmd_for_each_ref (int argc,const char **argv,const char *prefix);extern int cmd_format_patch (int argc,const char **argv,const char *prefix); +extern int cmd_fsck (int argc,const char **argv,const char *prefix);extern int cmd_get_tar_commit_id (int argc,const char **argv,const char *prefix);extern int cmd_grep (int argc,const char **argv,const char *prefix);extern int cmd_help (int argc,const char **argv,const char *prefix);
git.c +2 -0
@@ -235,6 +235,8 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP }, { "for-each-ref", cmd_for_each_ref, RUN_SETUP }, { "format-patch", cmd_format_patch, RUN_SETUP }, + { "fsck", cmd_fsck, RUN_SETUP }, + { "fsck-objects", cmd_fsck, RUN_SETUP }, { "get-tar-commit-id", cmd_get_tar_commit_id }, { "grep", cmd_grep, RUN_SETUP }, { "help", cmd_help },
Signature · 3 lines
1.5.0.rc2.75.gdbaa0-dirty -- [mdw]
Re: [PATCH] Make fsck and fsck-objects be builtins.
Sorry, and thanks.
Re: [PATCH] user-manual: set user.name and user.email with repo-config
In reply to Linus TorvaldsQuoted 8 lines · Linus Torvalds
What would also mean that we'd have the man-page with a simple
man git-config
which makes tons of sense if it documents both the config file *and* the "git config" program.
Or is that too sneaky?
I like that.
If the solution can help us deprecate and eventually remove git-var that would be ultra-nice.
Re: [PATCH] user-manual: set user.name and user.email with repo-config
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · Linus Torvalds
What would also mean that we'd have the man-page with a simple
man git-config
which makes tons of sense if it documents both the config file *and* the "git config" program.
Quoted 6 lines
Quoted 1 line
Or is that too sneaky?
I like that.
If the solution can help us deprecate and eventually remove git-var that would be ultra-nice.
What about env part of git-var output:
$ git var -l alias.less=-p cat-file -p core.repositoryformatversion=0 core.filemode=true [...] GIT_COMMITTER_IDENT=Jakub Narebski <[email protected]> 1169974258 +0100 GIT_AUTHOR_IDENT=Jakub Narebski <[email protected]> 1169974258 +0100
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Re: [PATCH] user-manual: set user.name and user.email with repo-config
In reply to Linus TorvaldsQuoted 5 lines · Linus Torvalds
Many people thought "git init-db" was confusing, and now we call it just "git init".
Can I vote for doing that for "git repo-config" too? Is there something wrong with just calling it "git config"?
I really think this is an excellent suggestion.
In fact I wonder why I didn't suggest it myself in the first place. ;-)
Nicolas
Re: [PATCH] user-manual: set user.name and user.email with repo-config
In reply to Linus TorvaldsQuoted 6 lines · Linus Torvalds
What would also mean that we'd have the man-page with a simple
man git-config
which makes tons of sense if it documents both the config file *and* the "git config" program.
Actually it should be git-config(5) for format and git-config(1) for program ;-P
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git