From: Junio C Hamano Date: Sun, 13 Jul 2008 22:45:38 +0000 (-0700) Subject: Merge branch 'maint' to sync with 1.5.6.3 X-Git-Tag: v1.6.0-rc0~84 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/447d0cca45920bbe409361bb532444f810c75546?hp=-c Merge branch 'maint' to sync with 1.5.6.3 * maint: GIT 1.5.6.3 git-am: Do not exit silently if committer is unset t0004: fix timing bug git-mailinfo: document the -n option Fix backwards-incompatible handling of core.sharedRepository --- 447d0cca45920bbe409361bb532444f810c75546 diff --combined Documentation/git-mailinfo.txt index cc52db3bef,1e126f4a5c..316bcc6796 --- a/Documentation/git-mailinfo.txt +++ b/Documentation/git-mailinfo.txt @@@ -8,7 -8,7 +8,7 @@@ git-mailinfo - Extracts patch and autho SYNOPSIS -------- - 'git mailinfo' [-k] [-u | --encoding=] -'git-mailinfo' [-k] [-u | --encoding= | -n] ++'git mailinfo' [-k] [-u | --encoding= | -n] DESCRIPTION @@@ -16,7 -16,7 +16,7 @@@ Reading a single e-mail message from the standard input, and writes the commit log message in file, and the patches in file. The author name, e-mail and e-mail subject are -written out to the standard output to be used by git-am +written out to the standard output to be used by 'git-am' to create a commit. It is usually not necessary to use this command directly. See linkgit:git-am[1] instead. @@@ -29,8 -29,8 +29,8 @@@ OPTION among which (1) remove 'Re:' or 're:', (2) leading whitespaces, (3) '[' up to ']', typically '[PATCH]', and then prepends "[PATCH] ". This flag forbids this - munging, and is most useful when used to read back 'git - format-patch -k' output. + munging, and is most useful when used to read back + 'git-format-patch -k' output. -u:: The commit log message, author name and author email are @@@ -46,6 -46,9 +46,9 @@@ conversion, even with this flag from what is specified by i18n.commitencoding, this flag can be used to override it. + -n:: + Disable all charset re-coding of the metadata. + :: The commit log message extracted from e-mail, usually except the title line which comes from e-mail Subject. diff --combined Documentation/git.txt index 4ecdc9f876,33ae79b9d5..27b9d31f7e --- a/Documentation/git.txt +++ b/Documentation/git.txt @@@ -20,11 -20,11 +20,11 @@@ Git is a fast, scalable, distributed re unusually rich command set that provides both high-level operations and full access to internals. -See this linkgit:gittutorial[7][tutorial] to get started, then see +See linkgit:gittutorial[7] to get started, then see link:everyday.html[Everyday Git] for a useful minimum set of commands, and "man git-commandname" for documentation of each command. CVS users may -also want to read linkgit:gitcvs-migration[7][CVS migration]. See -link:user-manual.html[Git User's Manual] for a more in-depth +also want to read linkgit:gitcvs-migration[7]. See +the link:user-manual.html[Git User's Manual] for a more in-depth introduction. The COMMAND is either a name of a Git command (see below) or an alias @@@ -43,9 -43,10 +43,10 @@@ unreleased) version of git, that is ava branch of the `git.git` repository. Documentation for older releases are available here: - * link:v1.5.6.2/git.html[documentation for release 1.5.6.2] + * link:v1.5.6.3/git.html[documentation for release 1.5.6.3] * release notes for + link:RelNotes-1.5.6.3.txt[1.5.6.3]. link:RelNotes-1.5.6.2.txt[1.5.6.2]. link:RelNotes-1.5.6.1.txt[1.5.6.1]. link:RelNotes-1.5.6.txt[1.5.6]. @@@ -136,13 -137,13 +137,13 @@@ OPTION + Other options are available to control how the manual page is displayed. See linkgit:git-help[1] for more information, -because 'git --help ...' is converted internally into 'git -help ...'. +because `git --help ...` is converted internally into `git +help ...`. --exec-path:: Path to wherever your core git programs are installed. This can also be controlled by setting the GIT_EXEC_PATH - environment variable. If no path is given 'git' will print + environment variable. If no path is given, 'git' will print the current setting and then exit. -p:: @@@ -183,14 -184,13 +184,14 @@@ See the references above to get starte probably more detail than necessary for a first-time user. The link:user-manual.html#git-concepts[git concepts chapter of the -user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial] both provide +user-manual] and linkgit:gitcore-tutorial[7] both provide introductions to the underlying git architecture. See also the link:howto-index.html[howto] documents for some useful examples. -The internals are documented link:technical/api-index.html[here]. +The internals are documented in the +link:technical/api-index.html[GIT API documentation]. GIT COMMANDS ------------ @@@ -374,9 -374,10 +375,9 @@@ For a more complete list of ways to spe File/Directory Structure ------------------------ -Please see the linkgit:gitrepository-layout[5][repository layout] -document. +Please see the linkgit:gitrepository-layout[5] document. -Read linkgit:githooks[5][hooks] for more details about each hook. +Read linkgit:githooks[5] for more details about each hook. Higher level SCMs may provide and manage additional information in the `$GIT_DIR`. @@@ -384,7 -385,7 +385,7 @@@ Terminology ----------- -Please see the linkgit:gitglossary[7][glossary] document. +Please see linkgit:gitglossary[7]. Environment Variables @@@ -411,9 -412,9 +412,9 @@@ git so take care if using Cogito etc 'GIT_ALTERNATE_OBJECT_DIRECTORIES':: Due to the immutable nature of git objects, old objects can be archived into shared, read-only directories. This variable - specifies a ":" separated list of git object directories which - can be used to search for git objects. New objects will not be - written to these directories. + specifies a ":" separated (on Windows ";" separated) list + of git object directories which can be used to search for git + objects. New objects will not be written to these directories. 'GIT_DIR':: If the 'GIT_DIR' environment variable is set then it @@@ -427,14 -428,6 +428,14 @@@ This can also be controlled by the '--work-tree' command line option and the core.worktree configuration variable. +'GIT_CEILING_DIRECTORIES':: + This should be a colon-separated list of absolute paths. + If set, it is a list of directories that git should not chdir + up into while looking for a repository directory. + It will not exclude the current working directory or + a GIT_DIR set on the command line or in the environment. + (Useful for excluding slow-loading network directories.) + git Commits ~~~~~~~~~~~ 'GIT_AUTHOR_NAME':: @@@ -492,10 -485,10 +493,10 @@@ othe a pager. 'GIT_SSH':: - If this environment variable is set then linkgit:git-fetch[1] - and linkgit:git-push[1] will use this command instead - of `ssh` when they need to connect to a remote system. - The 'GIT_SSH' command will be given exactly two arguments: + If this environment variable is set then 'git-fetch' + and 'git-push' will use this command instead + of 'ssh' when they need to connect to a remote system. + The '$GIT_SSH' command will be given exactly two arguments: the 'username@host' (or just 'host') from the URL and the shell command to execute on that remote system. + @@@ -509,8 -502,8 +510,8 @@@ for further details 'GIT_FLUSH':: If this environment variable is set to "1", then commands such - as git-blame (in incremental mode), git-rev-list, git-log, - git-whatchanged, etc., will force a flush of the output stream + as 'git-blame' (in incremental mode), 'git-rev-list', 'git-log', + and 'git-whatchanged' will force a flush of the output stream after each commit-oriented record have been flushed. If this variable is set to "0", the output of these commands will be done using completely buffered I/O. If this environment variable is @@@ -536,7 -529,7 +537,7 @@@ Discussion[[Discussion] More detail on the following is available from the link:user-manual.html#git-concepts[git concepts chapter of the -user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial]. +user-manual] and linkgit:gitcore-tutorial[7]. A git project normally consists of a working directory with a ".git" subdirectory at the top level. The .git directory contains, among other @@@ -600,9 -593,9 +601,9 @@@ contributors on the git-list buf && *--dst != '/') + ; /* nothing */ + goto next; + } - int depth = MAXDEPTH; - char *last_elem = NULL; - struct stat st; + memcpy(dst, comp_start, comp_len); + dst += comp_len; + next: + comp_start = comp_end; + } - if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX) - die ("Too long path: %.*s", 60, path); - - while (depth--) { - if (stat(buf, &st) || !S_ISDIR(st.st_mode)) { - char *last_slash = strrchr(buf, '/'); - if (last_slash) { - *last_slash = '\0'; - last_elem = xstrdup(last_slash + 1); - } else { - last_elem = xstrdup(buf); - *buf = '\0'; - } - } + if (dst == buf) + *dst++ = '/'; + + *dst = '\0'; + return dst - buf; +} - if (*buf) { - if (!*cwd && !getcwd(cwd, sizeof(cwd))) - die ("Could not get current working directory"); +/* + * path = Canonical absolute path + * prefix_list = Colon-separated list of absolute paths + * + * Determines, for each path in parent_list, whether the "prefix" really + * is an ancestor directory of path. Returns the length of the longest + * ancestor directory, excluding any trailing slashes, or -1 if no prefix + * is an ancestor. (Note that this means 0 is returned if prefix_list is + * "/".) "/foo" is not considered an ancestor of "/foobar". Directories + * are not considered to be their own ancestors. path must be in a + * canonical form: empty components, or "." or ".." components are not + * allowed. prefix_list may be null, which is like "". + */ +int longest_ancestor_length(const char *path, const char *prefix_list) +{ + char buf[PATH_MAX+1]; + const char *ceil, *colon; + int len, max_len = -1; - if (chdir(buf)) - die ("Could not switch to '%s'", buf); - } - if (!getcwd(buf, PATH_MAX)) - die ("Could not get current working directory"); - - if (last_elem) { - int len = strlen(buf); - if (len + strlen(last_elem) + 2 > PATH_MAX) - die ("Too long path name: '%s/%s'", - buf, last_elem); - buf[len] = '/'; - strcpy(buf + len + 1, last_elem); - free(last_elem); - last_elem = NULL; - } + if (prefix_list == NULL || !strcmp(path, "/")) + return -1; - if (!lstat(buf, &st) && S_ISLNK(st.st_mode)) { - len = readlink(buf, next_buf, PATH_MAX); - if (len < 0) - die ("Invalid symlink: %s", buf); - next_buf[len] = '\0'; - buf = next_buf; - buf_index = 1 - buf_index; - next_buf = bufs[buf_index]; - } else - break; + for (colon = ceil = prefix_list; *colon; ceil = colon+1) { + for (colon = ceil; *colon && *colon != ':'; colon++); + len = colon - ceil; + if (len == 0 || len > PATH_MAX || !is_absolute_path(ceil)) + continue; + strlcpy(buf, ceil, len+1); + len = normalize_absolute_path(buf, buf); + /* Strip "trailing slashes" from "/". */ + if (len == 1) + len = 0; + + if (!strncmp(path, buf, len) && + path[len] == '/' && + len > max_len) { + max_len = len; + } } - if (*cwd && chdir(cwd)) - die ("Could not change back to '%s'", cwd); - - return buf; + return max_len; }