From: Junio C Hamano Date: Sat, 24 Feb 2007 09:43:28 +0000 (-0800) Subject: Merge branch 'js/etc-config' X-Git-Tag: v1.5.1-rc1~137 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/cc58fc0684396c5298b21c97f00a568e46224258?ds=inline;hp=-c Merge branch 'js/etc-config' * js/etc-config: Make tests independent of global config files config: read system-wide defaults from /etc/gitconfig --- cc58fc0684396c5298b21c97f00a568e46224258 diff --combined Documentation/config.txt index 70f548464a,1dd90d8046..6309d89b4b --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -5,7 -5,8 +5,8 @@@ The git configuration file contains a n the git command's behavior. `.git/config` file for each repository is used to store the information for that repository, and `$HOME/.gitconfig` is used to store per user information to give - fallback values for `.git/config` file. + fallback values for `.git/config` file. The file `/etc/gitconfig` + can be used to store system-wide defaults. They can be used by both the git plumbing and the porcelains. The variables are divided into sections, where @@@ -142,18 -143,6 +143,18 @@@ core.preferSymlinkRefs: This is sometimes needed to work with old scripts that expect HEAD to be a symbolic link. +core.bare:: + If true this repository is assumed to be 'bare' and has no + working directory associated with it. If this is the case a + number of commands that require a working directory will be + disabled, such as gitlink:git-add[1] or gitlink:git-merge[1]. ++ +This setting is automatically guessed by gitlink:git-clone[1] or +gitlink:git-init[1] when the repository was created. By default a +repository that ends in "/.git" is assumed to be not bare (bare = +false), while all other repositories are assumed to be bare (bare += true). + core.logAllRefUpdates:: Updates to a ref is logged to the file "$GIT_DIR/logs/", by appending the new and old @@@ -192,17 -181,10 +193,17 @@@ core.compression: slowest. core.legacyheaders:: - A boolean which enables the legacy object header format in case - you want to interoperate with old clients accessing the object - database directly (where the "http://" and "rsync://" protocols - count as direct access). + A boolean which + changes the format of loose objects so that they are more + efficient to pack and to send out of the repository over git + native protocol, since v1.4.2. However, loose objects + written in the new format cannot be read by git older than + that version; people fetching from your repository using + older versions of git over dumb transports (e.g. http) + will also be affected. ++ +To let git use the new loose object format, you have to +set core.legacyheaders to false. core.packedGitWindowSize:: Number of bytes of a pack file to map into memory in a @@@ -470,10 -452,6 +471,10 @@@ remote..push: The default set of "refspec" for gitlink:git-push[1]. See gitlink:git-push[1]. +remote..skipDefaultUpdate:: + If true, this remote will be skipped by default when updating + using the remote subcommand of gitlink:git-remote[1]. + remote..receivepack:: The default program to execute on the remote side when pushing. See option \--exec of gitlink:git-push[1]. @@@ -482,10 -460,6 +483,10 @@@ remote..uploadpack: The default program to execute on the remote side when fetching. See option \--exec of gitlink:git-fetch-pack[1]. +remotes.:: + The list of remotes which are fetched by "git remote update + ". See gitlink:git-remote[1]. + repack.usedeltabaseoffset:: Allow gitlink:git-repack[1] to create packs that uses delta-base offset. Defaults to false. diff --combined Makefile index fbe05f938e,203aac4517..e51b448c78 --- a/Makefile +++ b/Makefile @@@ -28,10 -28,6 +28,10 @@@ all: # # Define NO_STRLCPY if you don't have strlcpy. # +# Define NO_STRTOUMAX if you don't have strtoumax in the C library. +# If your compiler also does not support long long or does not have +# strtoull, define NO_STRTOULL. +# # Define NO_SETENV if you don't have setenv in the C library. # # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. @@@ -128,6 -124,7 +128,7 @@@ prefix = $(HOME bindir = $(prefix)/bin gitexecdir = $(bindir) template_dir = $(prefix)/share/git-core/templates/ + ETC_GITCONFIG = $(prefix)/etc/gitconfig # DESTDIR= # default configuration for gitweb @@@ -176,7 -173,7 +177,7 @@@ SCRIPT_SH = git-merge-one-file.sh git-parse-remote.sh \ git-pull.sh git-rebase.sh \ git-repack.sh git-request-pull.sh git-reset.sh \ - git-resolve.sh git-revert.sh git-sh-setup.sh \ + git-revert.sh git-sh-setup.sh \ git-tag.sh git-verify-tag.sh \ git-applymbox.sh git-applypatch.sh git-am.sh \ git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ @@@ -266,8 -263,7 +267,8 @@@ LIB_OBJS = revision.o pager.o tree-walk.o xdiff-interface.o \ write_or_die.o trace.o list-objects.o grep.o \ alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ - color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o + color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ + convert.o BUILTIN_OBJS = \ builtin-add.o \ @@@ -285,6 -281,7 +286,6 @@@ builtin-diff.o \ builtin-diff-files.o \ builtin-diff-index.o \ - builtin-diff-stages.o \ builtin-diff-tree.o \ builtin-fmt-merge-msg.o \ builtin-for-each-ref.o \ @@@ -296,7 -293,6 +297,7 @@@ builtin-ls-tree.o \ builtin-mailinfo.o \ builtin-mailsplit.o \ + builtin-merge-base.o \ builtin-merge-file.o \ builtin-mv.o \ builtin-name-rev.o \ @@@ -358,13 -354,11 +359,13 @@@ ifeq ($(uname_S),SunOS NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease + NO_STRTOUMAX = YesPlease endif ifeq ($(uname_R),5.9) NO_UNSETENV = YesPlease NO_SETENV = YesPlease NO_C99_FORMAT = YesPlease + NO_STRTOUMAX = YesPlease endif INSTALL = ginstall TAR = gtar @@@ -524,13 -518,6 +525,13 @@@ ifdef NO_STRLCP COMPAT_CFLAGS += -DNO_STRLCPY COMPAT_OBJS += compat/strlcpy.o endif +ifdef NO_STRTOUMAX + COMPAT_CFLAGS += -DNO_STRTOUMAX + COMPAT_OBJS += compat/strtoumax.o +endif +ifdef NO_STRTOULL + COMPAT_CFLAGS += -DNO_STRTOULL +endif ifdef NO_SETENV COMPAT_CFLAGS += -DNO_SETENV COMPAT_OBJS += compat/setenv.o @@@ -598,6 -585,7 +599,7 @@@ endi # Shell quote (do not use $(call) to accommodate ancient setups); SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) + ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) bindir_SQ = $(subst ','\'',$(bindir)) @@@ -610,7 -598,8 +612,8 @@@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PA LIBS = $(GITLIBS) $(EXTLIBS) - BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS) + BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ + -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $(COMPAT_CFLAGS) LIB_OBJS += $(COMPAT_OBJS) ALL_CFLAGS += $(BASIC_CFLAGS) @@@ -896,8 -885,7 +899,8 @@@ dist: git.spec git-archiv $(TAR) rf $(GIT_TARNAME).tar \ $(GIT_TARNAME)/git.spec \ $(GIT_TARNAME)/version \ - $(GIT_TARNAME)/git-gui/version + $(GIT_TARNAME)/git-gui/version \ + $(GIT_TARNAME)/git-gui/credits @rm -rf $(GIT_TARNAME) gzip -f -9 $(GIT_TARNAME).tar @@@ -954,14 -942,11 +957,14 @@@ check-docs: case "$$v" in \ git-merge-octopus | git-merge-ours | git-merge-recursive | \ git-merge-resolve | git-merge-stupid | \ + git-add--interactive | git-fsck-objects | git-init-db | \ + git-repo-config | \ git-ssh-pull | git-ssh-push ) continue ;; \ esac ; \ test -f "Documentation/$$v.txt" || \ echo "no doc: $$v"; \ - grep -q "^gitlink:$$v\[[0-9]\]::" Documentation/git.txt || \ + sed -e '1,/^__DATA__/d' Documentation/cmd-list.perl | \ + grep -q "^$$v[ ]" || \ case "$$v" in \ git) ;; \ *) echo "no link: $$v";; \ diff --combined config.c index 8b6cf1aaa5,b0c0948cc8..0ff413b804 --- a/config.c +++ b/config.c @@@ -310,14 -310,12 +310,14 @@@ int git_default_config(const char *var } if (!strcmp(var, "core.packedgitwindowsize")) { - int pgsz = getpagesize(); + int pgsz_x2 = getpagesize() * 2; packed_git_window_size = git_config_int(var, value); - packed_git_window_size /= pgsz; - if (packed_git_window_size < 2) - packed_git_window_size = 2; - packed_git_window_size *= pgsz; + + /* This value must be multiple of (pagesize * 2) */ + packed_git_window_size /= pgsz_x2; + if (packed_git_window_size < 1) + packed_git_window_size = 1; + packed_git_window_size *= pgsz_x2; return 0; } @@@ -326,15 -324,6 +326,15 @@@ return 0; } + if (!strcmp(var, "core.autocrlf")) { + if (value && !strcasecmp(value, "input")) { + auto_crlf = -1; + return 0; + } + auto_crlf = git_config_bool(var, value); + return 0; + } + if (!strcmp(var, "user.name")) { strlcpy(git_default_name, value, sizeof(git_default_name)); return 0; @@@ -394,6 -383,8 +394,8 @@@ int git_config(config_fn_t fn * config file otherwise. */ filename = getenv(CONFIG_ENVIRONMENT); if (!filename) { + if (!access(ETC_GITCONFIG, R_OK)) + ret += git_config_from_file(fn, ETC_GITCONFIG); home = getenv("HOME"); filename = getenv(CONFIG_LOCAL_ENVIRONMENT); if (!filename)