From 300e39f6aa974cebf09b5983b923a2bea23146ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 22 Feb 2013 19:09:23 +0700 Subject: index-format.txt: mention of v4 is missing in some places MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt index 7324154..dcd51b9 100644 --- a/Documentation/technical/index-format.txt +++ b/Documentation/technical/index-format.txt @@ -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 -- cgit v0.10.2-6-g49f6 From b82a7b5bbc1c86d5f6d4198f694b213360dc2485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Fri, 22 Feb 2013 19:09:24 +0700 Subject: read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 9d22778 (read-cache.c: write prefix-compressed names in the index - 2012-04-04) defined these. Interestingly, they were not used by read-cache.c, or anywhere in that patch. They were used in builtin/update-index.c later for checking supported index versions. Use them here too. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/read-cache.c b/read-cache.c index fda78bc..5cddbc3 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1256,7 +1256,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); -- cgit v0.10.2-6-g49f6 From 3d0e75f2f7a9ae9329154dc85bf5af5c5482f3ea Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 22 Feb 2013 22:24:10 -0800 Subject: diff-options: unconfuse description of --color It said "by default it is off" while it also said "the default is always", which confused everybody who read it only once. It wanted to say (1) if you do not say --color, it is not enabled, and (2) if you say --color but do not say when to enable it, it will always be enabled". Rephrase to clarify by using "default" only once. Signed-off-by: Junio C Hamano diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index cf4b216..d33f77a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -174,8 +174,8 @@ any of those replacements occurred. --color[=]:: Show colored diff. - The value must be `always` (the default for ``), `never`, or `auto`. - The default value is `never`. + `--color` (i.e. without '=') is the same as `--color=always`. + '' can be one of `always`, `never`, or `auto`. ifdef::git-diff[] It can be changed by the `color.ui` and `color.diff` configuration settings. -- cgit v0.10.2-6-g49f6 From 647d87947f8248df5608f621ece8b1dc875fa859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 23 Feb 2013 09:29:31 +0700 Subject: update-index: list supported idx versions and their features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt index 9d0b151..dd36d13 100644 --- a/Documentation/git-update-index.txt +++ b/Documentation/git-update-index.txt @@ -145,7 +145,15 @@ you will need to handle the situation manually. --index-version :: 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 -- cgit v0.10.2-6-g49f6 From 0414acc3651a8e3ad938336b596e3de85e5d5d33 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 23 Feb 2013 10:27:39 -0500 Subject: Documentation/githooks: Explain pre-rebase parameters Descriptions borrowed from templates/hooks--pre-rebase.sample. Signed-off-by: W. Trevor King Signed-off-by: Junio C Hamano diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index b9003fe..e711cf1 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -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 ~~~~~~~~~~~~~ -- cgit v0.10.2-6-g49f6 From 52291497d1ea112137237e6c719e832599eab526 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Mon, 25 Feb 2013 00:29:01 -0500 Subject: describe: Document --match pattern format It's not clear in git-describe(1) what kind of "pattern" should be passed to --match. Fix that. Signed-off-by: Greg Price Signed-off-by: Junio C Hamano diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt index 72d6bb6..711040d 100644 --- a/Documentation/git-describe.txt +++ b/Documentation/git-describe.txt @@ -81,8 +81,9 @@ OPTIONS that points at object deadbee....). --match :: - 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. -- cgit v0.10.2-6-g49f6 From 3b130ade45c70af63c7692387b65f161770a8ccc Mon Sep 17 00:00:00 2001 From: David Michael Date: Mon, 25 Feb 2013 14:30:19 -0500 Subject: git-compat-util.h: Provide missing netdb.h definitions Some platforms may lack the NI_MAXHOST and NI_MAXSERV values in their system headers, so ensure they are available. Signed-off-by: David Michael Signed-off-by: Junio C Hamano diff --git a/daemon.c b/daemon.c index ab21e66..34d95c1 100644 --- a/daemon.c +++ b/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 diff --git a/git-compat-util.h b/git-compat-util.h index 000042d..503282c 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -178,6 +178,17 @@ extern char *gitbasename(char *); #include #endif +/* On most systems 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 would have given us this, but * not on some systems (e.g. GNU/Hurd). */ -- cgit v0.10.2-6-g49f6 From bee3eb079d10bd309c75c39efa1e50fbb70931d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20Andrzej=20Kad=C5=82ubowski?= Date: Thu, 21 Feb 2013 21:22:50 +0100 Subject: git-filter-branch.txt: clarify ident variables usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a rare edge case of git-filter-branch: a filter that unsets identity variables from the environment. Link to git-commit-tree clarifies how Git would fall back in this situation. Signed-off-by: Tadeusz Andrzej Kadłubowski Signed-off-by: Junio C Hamano diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index e2301f5..c915d05 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -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 returns a non-zero exit status, the whole operation will be aborted. -- cgit v0.10.2-6-g49f6 From 21b6e4f24c74755d700d59edd47d5b88ff56ea5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20Andrzej=20Kad=C5=82ubowski?= Date: Thu, 21 Feb 2013 21:23:38 +0100 Subject: Documentation: filter-branch env-filter example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit filter-branch --env-filter example that shows how to change the email address in all commits before publishing a project. Signed-off-by: Tadeusz Andrzej Kadłubowski Signed-off-by: Junio C Hamano diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index c915d05..69a40b2 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -332,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 -- cgit v0.10.2-6-g49f6 From 71ba6b10f81ac8afcb0ba376f6691afe1269467c Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 7 Mar 2013 01:56:35 +0100 Subject: bundle: Fix "verify" output if history is complete A more informative message for "complete" bundles was added in commit 8c3710fd3011 (tweak "bundle verify" of a complete history, 2012-06-04). However, the prerequisites ref list is currently read *after* we check if it equals zero, which means we never actually use the number of prerequisite refs to decide when to print the newly introduced message. The code incorrectly uses the number of references recorded in the bundle instead. Signed-off-by: Lukas Fleischer Signed-off-by: Junio C Hamano diff --git a/bundle.c b/bundle.c index 8d12816..65db53b 100644 --- a/bundle.c +++ b/bundle.c @@ -188,10 +188,10 @@ int verify_bundle(struct bundle_header *header, int verbose) 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", r->nr), -- cgit v0.10.2-6-g49f6 From a02ffe0e1a19c9594af3e81f4e04b46eabe4755a Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 8 Mar 2013 19:01:26 +0100 Subject: bundle: Add colons to list headings in "verify" These slightly improve the reading flow by making it obvious that a list follows. Also, make the wording of both headings consistent by changing "contains %d ref(s)" to "contains this ref"/"contains these %d refs". Signed-off-by: Lukas Fleischer Signed-off-by: Junio C Hamano diff --git a/bundle.c b/bundle.c index 65db53b..6210a6b 100644 --- a/bundle.c +++ b/bundle.c @@ -183,8 +183,8 @@ 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); @@ -192,8 +192,8 @@ int verify_bundle(struct bundle_header *header, int verbose) if (!r->nr) { printf_ln(_("The bundle records a complete history.")); } else { - 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); -- cgit v0.10.2-6-g49f6