mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
Merge branch 'maint-1.8.1' into maint
* maint-1.8.1: bundle: Add colons to list headings in "verify" bundle: Fix "verify" output if history is complete Documentation: filter-branch env-filter example git-filter-branch.txt: clarify ident variables usage git-compat-util.h: Provide missing netdb.h definitions describe: Document --match pattern format Documentation/githooks: Explain pre-rebase parameters update-index: list supported idx versions and their features diff-options: unconfuse description of --color read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() index-format.txt: mention of v4 is missing in some places
This commit is contained in:
commit
f7b1ad870c
@ -195,8 +195,8 @@ any of those replacements occurred.
|
||||
|
||||
--color[=<when>]::
|
||||
Show colored diff.
|
||||
The value must be `always` (the default for `<when>`), `never`, or `auto`.
|
||||
The default value is `never`.
|
||||
`--color` (i.e. without '=<when>') is the same as `--color=always`.
|
||||
'<when>' can be one of `always`, `never`, or `auto`.
|
||||
ifdef::git-diff[]
|
||||
It can be changed by the `color.ui` and `color.diff`
|
||||
configuration settings.
|
||||
|
@ -81,8 +81,9 @@ OPTIONS
|
||||
that points at object deadbee....).
|
||||
|
||||
--match <pattern>::
|
||||
Only consider tags matching the given pattern (can be used to avoid
|
||||
leaking private tags made from the repository).
|
||||
Only consider tags matching the given `glob(7)` pattern,
|
||||
excluding the "refs/tags/" prefix. This can be used to avoid
|
||||
leaking private tags from the repository.
|
||||
|
||||
--always::
|
||||
Show uniquely abbreviated commit object as fallback.
|
||||
|
@ -64,8 +64,11 @@ argument is always evaluated in the shell context using the 'eval' command
|
||||
Prior to that, the $GIT_COMMIT environment variable will be set to contain
|
||||
the id of the commit being rewritten. Also, GIT_AUTHOR_NAME,
|
||||
GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL,
|
||||
and GIT_COMMITTER_DATE are set according to the current commit. The values
|
||||
of these variables after the filters have run, are used for the new commit.
|
||||
and GIT_COMMITTER_DATE are taken from the current commit and exported to
|
||||
the environment, in order to affect the author and committer identities of
|
||||
the replacement commit created by linkgit:git-commit-tree[1] after the
|
||||
filters have run.
|
||||
|
||||
If any evaluation of <command> returns a non-zero exit status, the whole
|
||||
operation will be aborted.
|
||||
|
||||
@ -329,6 +332,26 @@ git filter-branch --msg-filter '
|
||||
' HEAD~10..HEAD
|
||||
--------------------------------------------------------
|
||||
|
||||
The `--env-filter` option can be used to modify committer and/or author
|
||||
identity. For example, if you found out that your commits have the wrong
|
||||
identity due to a misconfigured user.email, you can make a correction,
|
||||
before publishing the project, like this:
|
||||
|
||||
--------------------------------------------------------
|
||||
git filter-branch --env-filter '
|
||||
if test "$GIT_AUTHOR_EMAIL" = "root@localhost"
|
||||
then
|
||||
GIT_AUTHOR_EMAIL=john@example.com
|
||||
export GIT_AUTHOR_EMAIL
|
||||
fi
|
||||
if test "$GIT_COMMITTER_EMAIL" = "root@localhost"
|
||||
then
|
||||
GIT_COMMITTER_EMAIL=john@example.com
|
||||
export GIT_COMMITTER_EMAIL
|
||||
fi
|
||||
' -- --all
|
||||
--------------------------------------------------------
|
||||
|
||||
To restrict rewriting to only part of the history, specify a revision
|
||||
range in addition to the new branch name. The new branch name will
|
||||
point to the top-most revision that a 'git rev-list' of this range
|
||||
|
@ -145,7 +145,15 @@ you will need to handle the situation manually.
|
||||
|
||||
--index-version <n>::
|
||||
Write the resulting index out in the named on-disk format version.
|
||||
The current default version is 2.
|
||||
Supported versions are 2, 3 and 4. The current default version is 2
|
||||
or 3, depending on whether extra features are used, such as
|
||||
`git add -N`.
|
||||
+
|
||||
Version 4 performs a simple pathname compression that reduces index
|
||||
size by 30%-50% on large repositories, which results in faster load
|
||||
time. Version 4 is relatively young (first released in in 1.8.0 in
|
||||
October 2012). Other Git implementations such as JGit and libgit2
|
||||
may not support it yet.
|
||||
|
||||
-z::
|
||||
Only meaningful with `--stdin` or `--index-info`; paths are
|
||||
|
@ -140,9 +140,11 @@ the outcome of 'git commit'.
|
||||
pre-rebase
|
||||
~~~~~~~~~~
|
||||
|
||||
This hook is called by 'git rebase' and can be used to prevent a branch
|
||||
from getting rebased.
|
||||
|
||||
This hook is called by 'git rebase' and can be used to prevent a
|
||||
branch from getting rebased. The hook may be called with one or
|
||||
two parameters. The first parameter is the upstream from which
|
||||
the series was forked. The second parameter is the branch being
|
||||
rebased, and is not set when rebasing the current branch.
|
||||
|
||||
post-checkout
|
||||
~~~~~~~~~~~~~
|
||||
|
@ -12,7 +12,7 @@ Git index format
|
||||
The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache")
|
||||
|
||||
4-byte version number:
|
||||
The current supported versions are 2 and 3.
|
||||
The current supported versions are 2, 3 and 4.
|
||||
|
||||
32-bit number of index entries.
|
||||
|
||||
@ -93,8 +93,8 @@ Git index format
|
||||
12-bit name length if the length is less than 0xFFF; otherwise 0xFFF
|
||||
is stored in this field.
|
||||
|
||||
(Version 3) A 16-bit field, only applicable if the "extended flag"
|
||||
above is 1, split into (high to low bits).
|
||||
(Version 3 or later) A 16-bit field, only applicable if the
|
||||
"extended flag" above is 1, split into (high to low bits).
|
||||
|
||||
1-bit reserved for future
|
||||
|
||||
|
10
bundle.c
10
bundle.c
@ -183,17 +183,17 @@ int verify_bundle(struct bundle_header *header, int verbose)
|
||||
struct ref_list *r;
|
||||
|
||||
r = &header->references;
|
||||
printf_ln(Q_("The bundle contains %d ref",
|
||||
"The bundle contains %d refs",
|
||||
printf_ln(Q_("The bundle contains this ref:",
|
||||
"The bundle contains these %d refs:",
|
||||
r->nr),
|
||||
r->nr);
|
||||
list_refs(r, 0, NULL);
|
||||
r = &header->prerequisites;
|
||||
if (!r->nr) {
|
||||
printf_ln(_("The bundle records a complete history."));
|
||||
} else {
|
||||
r = &header->prerequisites;
|
||||
printf_ln(Q_("The bundle requires this ref",
|
||||
"The bundle requires these %d refs",
|
||||
printf_ln(Q_("The bundle requires this ref:",
|
||||
"The bundle requires these %d refs:",
|
||||
r->nr),
|
||||
r->nr);
|
||||
list_refs(r, 0, NULL);
|
||||
|
4
daemon.c
4
daemon.c
@ -9,10 +9,6 @@
|
||||
#define HOST_NAME_MAX 256
|
||||
#endif
|
||||
|
||||
#ifndef NI_MAXSERV
|
||||
#define NI_MAXSERV 32
|
||||
#endif
|
||||
|
||||
#ifdef NO_INITGROUPS
|
||||
#define initgroups(x, y) (0) /* nothing */
|
||||
#endif
|
||||
|
@ -213,6 +213,17 @@ extern char *gitbasename(char *);
|
||||
#include <openssl/err.h>
|
||||
#endif
|
||||
|
||||
/* On most systems <netdb.h> would have given us this, but
|
||||
* not on some systems (e.g. z/OS).
|
||||
*/
|
||||
#ifndef NI_MAXHOST
|
||||
#define NI_MAXHOST 1025
|
||||
#endif
|
||||
|
||||
#ifndef NI_MAXSERV
|
||||
#define NI_MAXSERV 32
|
||||
#endif
|
||||
|
||||
/* On most systems <limits.h> would have given us this, but
|
||||
* not on some systems (e.g. GNU/Hurd).
|
||||
*/
|
||||
|
@ -1260,7 +1260,7 @@ static int verify_hdr(struct cache_header *hdr, unsigned long size)
|
||||
if (hdr->hdr_signature != htonl(CACHE_SIGNATURE))
|
||||
return error("bad signature");
|
||||
hdr_version = ntohl(hdr->hdr_version);
|
||||
if (hdr_version < 2 || 4 < hdr_version)
|
||||
if (hdr_version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < hdr_version)
|
||||
return error("bad index version %d", hdr_version);
|
||||
git_SHA1_Init(&c);
|
||||
git_SHA1_Update(&c, hdr, size - 20);
|
||||
|
Loading…
Reference in New Issue
Block a user