From 16adc7cb048f9c31e80b4409aa599d485595c4e0 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 2 Jul 2010 10:29:07 -0700 Subject: [PATCH 1/6] Updates from the list to 1.7.2 Release Notes Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.7.2.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Documentation/RelNotes-1.7.2.txt b/Documentation/RelNotes-1.7.2.txt index aa79f06851..b463fd2ae2 100644 --- a/Documentation/RelNotes-1.7.2.txt +++ b/Documentation/RelNotes-1.7.2.txt @@ -4,10 +4,13 @@ Git v1.7.2 Release Notes (draft) Updates since v1.7.1 -------------------- - * core.eol configuration and eol attribute are the new way to control - the end of line conventions for files in the working tree; - core.autocrlf overrides it, keeping the traditional behaviour by - default. + * core.eol configuration and text/eol attributes are the new way to control + the end of line conventions for files in the working tree. + + * core.autocrlf has been made safer - it will now only handle line + endings for new files and files that are LF-only in the + repository. To normalize content that has been checked in with + CRLF, use the new eol/text attributes. * The whitespace rules used in "git apply --whitespace" and "git diff" gained a new member in the family (tab-in-indent) to help projects with @@ -45,8 +48,12 @@ Updates since v1.7.1 commit. * "git cherry-pick" learned to pick a range of commits - (e.g. "cherry-pick A..B" and "cherry-pick --stdin"); this does not - have nicer sequencing control "rebase [-i]" has, though. + (e.g. "cherry-pick A..B" and "cherry-pick --stdin"), so did "git + revert"; these do not support the nicer sequencing control "rebase + [-i]" has, though. + + * "git cherry-pick" and "git revert" learned --strategy option to specify + the merge strategy to be used when performing three-way merges. * "git cvsserver" can be told to use pserver; its password file can be stored outside the repository. @@ -74,7 +81,7 @@ Updates since v1.7.1 * Various options to "git grep" (e.g. --count, --name-only) work better with binary files. - * "git grep" learned "-Ovi" to open the files with hits in yoru editor. + * "git grep" learned "-Ovi" to open the files with hits in your editor. * "git help -w" learned "chrome" and "chromium" browsers. @@ -96,8 +103,6 @@ Updates since v1.7.1 * "git remote" learned "set-branches" subcommand. - * "git revert" learned --strategy option to specify the merge strategy. - * "git rev-list A..B" learned --ancestry-path option to further limit the result to the commits that are on the ancestry chain between A and B (i.e. commits that are not descendants of A are excluded). @@ -147,9 +152,6 @@ release, unless otherwise noted. * "git diff" could show ambiguous abbreviation of blob object names on its "index" line (3e5a188). - * "git rebase" did not faithfully reproduce a malformed author ident, that - is often seen in a repository converted from foreign SCMs (43c23251). - * "git reset --hard" started from a wrong directory and a working tree in a nonstandard location is in use got confused (560fb6a1). From 66bd8ab899d442926ad45d63cd5ad63ab5bb81b2 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Wed, 30 Jun 2010 13:41:27 -0700 Subject: [PATCH 2/6] Documentation/git-gc.txt: add reference to githooks This advertises the existence of the 'pre-auto-gc' hook and adds a cross reference to where the hook is documented. Signed-off-by: Chris Packham Signed-off-by: Junio C Hamano --- Documentation/git-gc.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index 189573a3b3..cbe74d531a 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -127,6 +127,13 @@ If you are expecting some objects to be collected and they aren't, check all of those locations and decide whether it makes sense in your case to remove those references. +HOOKS +----- + +The 'git gc --auto' command will run the 'pre-auto-gc' hook. See +linkgit:githooks[5] for more information. + + SEE ALSO -------- linkgit:git-prune[1] From 2c64034491e302fa12ac86365dd872d9a75dc855 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 5 Jul 2010 15:15:20 +0200 Subject: [PATCH 3/6] rerere.txt: Document forget subcommand dea4562 (rerere forget path: forget recorded resolution, 2009-12-25) introduced the forget subcommand for rerere. Document it. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/git-rerere.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt index acc220a00f..db99d4786e 100644 --- a/Documentation/git-rerere.txt +++ b/Documentation/git-rerere.txt @@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges SYNOPSIS -------- -'git rerere' ['clear'|'diff'|'status'|'gc'] +'git rerere' ['clear'|'forget' []|'diff'|'status'|'gc'] DESCRIPTION ----------- @@ -40,6 +40,11 @@ This resets the metadata used by rerere if a merge resolution is to be aborted. Calling 'git am [--skip|--abort]' or 'git rebase [--skip|--abort]' will automatically invoke this command. +'forget' :: + +This resets the conflict resolutions which rerere has recorded for the current +conflict in . The is optional. + 'diff':: This displays diffs for the current state of the resolution. It is From 6b097788f88a29d6e171af7a9e87117cf992e833 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 4 Jul 2010 06:48:35 -0400 Subject: [PATCH 4/6] t0006: test timezone parsing Previously, test-date simply ignored the parsed timezone and told show_date() to use UTC. Instead, let's print out what we actually parsed. While we're at it, let's make it easy for tests to work in a specific timezone. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t0006-date.sh | 5 +++-- test-date.c | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/t/t0006-date.sh b/t/t0006-date.sh index 75b02af86d..3ea4f9eff9 100755 --- a/t/t0006-date.sh +++ b/t/t0006-date.sh @@ -28,8 +28,8 @@ check_show 31449600 '12 months ago' check_parse() { echo "$1 -> $2" >expect - test_expect_${3:-success} "parse date ($1)" " - test-date parse '$1' >actual && + test_expect_${4:-success} "parse date ($1${3:+ TZ=$3})" " + TZ=${3:-$TZ} test-date parse '$1' >actual && test_cmp expect actual " } @@ -38,6 +38,7 @@ check_parse 2008 bad check_parse 2008-02 bad check_parse 2008-02-14 bad check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 +0000' +check_parse '2008-02-14 20:30:45 -0500' '2008-02-14 20:30:45 -0500' check_approxidate() { echo "$1 -> $2 +0000" >expect diff --git a/test-date.c b/test-date.c index a9e705f79a..ac6854a541 100644 --- a/test-date.c +++ b/test-date.c @@ -21,12 +21,15 @@ static void parse_dates(char **argv, struct timeval *now) for (; *argv; argv++) { char result[100]; time_t t; + int tz; result[0] = 0; parse_date(*argv, result, sizeof(result)); - t = strtoul(result, NULL, 0); - printf("%s -> %s\n", *argv, - t ? show_date(t, 0, DATE_ISO8601) : "bad"); + if (sscanf(result, "%ld %d", &t, &tz) == 2) + printf("%s -> %s\n", + *argv, show_date(t, tz, DATE_ISO8601)); + else + printf("%s -> bad\n", *argv); } } From 9ba0f0334dd505f78e0374bbe857c5e202f5a778 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 4 Jul 2010 07:00:17 -0400 Subject: [PATCH 5/6] parse_date: fix signedness in timezone calculation When no timezone is specified, we deduce the offset by subtracting the result of mktime from our calculated timestamp. However, our timestamp is stored as an unsigned integer, meaning we perform the subtraction as unsigned. For a negative offset, this means we wrap to a very high number, and our numeric timezone is in the millions of hours. You can see this bug by doing: $ TZ=EST \ GIT_AUTHOR_DATE='2010-06-01 10:00' \ git commit -a -m foo $ git cat-file -p HEAD | grep author author Jeff King 1275404416 +119304128 Instead, we should perform this subtraction as a time_t, the same type that mktime returns. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- date.c | 2 +- t/t0006-date.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/date.c b/date.c index 68cdcaa3f6..3c981f7eb5 100644 --- a/date.c +++ b/date.c @@ -635,7 +635,7 @@ int parse_date_toffset(const char *date, unsigned long *timestamp, int *offset) /* mktime uses local timezone */ *timestamp = tm_to_time_t(&tm); if (*offset == -1) - *offset = (*timestamp - mktime(&tm)) / 60; + *offset = ((time_t)*timestamp - mktime(&tm)) / 60; if (*timestamp == -1) return -1; diff --git a/t/t0006-date.sh b/t/t0006-date.sh index 3ea4f9eff9..b2df4fe102 100755 --- a/t/t0006-date.sh +++ b/t/t0006-date.sh @@ -39,6 +39,7 @@ check_parse 2008-02 bad check_parse 2008-02-14 bad check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 +0000' check_parse '2008-02-14 20:30:45 -0500' '2008-02-14 20:30:45 -0500' +check_parse '2008-02-14 20:30:45' '2008-02-14 20:30:45 -0500' EST check_approxidate() { echo "$1 -> $2 +0000" >expect From 869d58813b24c74e84c9388041eafcef40cb51e4 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Mon, 5 Jul 2010 20:52:43 +0200 Subject: [PATCH 6/6] gitweb: Move evaluate_gitweb_config out of run_request Move evaluate_gitweb_config() and evaluate_git_version() out of run_request() to run(), making them not run one for each request. This changes how git behaves in FastCGI case. This change makes it impossible to have config which changes with request, but I don't think anyone relied on such (hidden action) behavior. While at it, reset timer and number of git commands at beginning of run_request() in new reset_timer() subroutine. This fixes case when gitweb was run using FastCGI interface: time is reported for request, and not for single run of gitweb script. This changes slightly behavior in non-FastCGI case: the number of git commands reported is 1 less (running `git --version` one per gitweb is not counted now). Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 9446376535..1f611d22d4 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1027,18 +1027,18 @@ sub dispatch { $actions{$action}->(); } -sub run_request { +sub reset_timer { our $t0 = [Time::HiRes::gettimeofday()] if defined $t0; + our $number_of_git_cmds = 0; +} + +sub run_request { + reset_timer(); evaluate_uri(); - evaluate_gitweb_config(); - evaluate_git_version(); check_loadavg(); - # $projectroot and $projects_list might be set in gitweb config file - $projects_list ||= $projectroot; - evaluate_query_params(); evaluate_path_info(); evaluate_and_validate_params(); @@ -1086,6 +1086,11 @@ sub evaluate_argv { sub run { evaluate_argv(); + evaluate_gitweb_config(); + evaluate_git_version(); + + # $projectroot and $projects_list might be set in gitweb config file + $projects_list ||= $projectroot; $pre_listen_hook->() if $pre_listen_hook;