From efe47f8f2c7d4e2b7ebedc15dbdd2cc51912b56f Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Thu, 24 Sep 2009 13:21:03 -0500 Subject: [PATCH 01/17] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER. Signed-off-by: Brandon Casey Signed-off-by: Shawn O. Pearce --- perl/Makefile.PL | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 320253eb8e..0b9deca2cc 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -5,6 +5,14 @@ sub MY::postamble { instlibdir: @echo '$(INSTALLSITELIB)' +ifneq (,$(DESTDIR)) +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10)) +$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \ + is likely incompatible with the DESTDIR mechanism. Try setting \ + NO_PERL_MAKEMAKER=1 instead) +endif +endif + MAKE_FRAG } From e648f8b6d0dc6fb7e8c8e3ed47eec6b12aaf450a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Thu, 24 Sep 2009 14:23:15 +0200 Subject: [PATCH 02/17] bash: teach 'git checkout' options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SZEDER Gábor Signed-off-by: Shawn O. Pearce --- contrib/completion/git-completion.bash | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6fd7e1d329..2c2a0d4614 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -810,7 +810,21 @@ _git_checkout () { __git_has_doubledash && return - __gitcomp "$(__git_refs)" + local cur="${COMP_WORDS[COMP_CWORD]}" + case "$cur" in + --conflict=*) + __gitcomp "diff3 merge" "" "${cur##--conflict=}" + ;; + --*) + __gitcomp " + --quiet --ours --theirs --track --no-track --merge + --conflict= --patch + " + ;; + *) + __gitcomp "$(__git_refs)" + ;; + esac } _git_cherry () From fb3650ed100a549f80d822f28ccf0f82e9f75f3e Mon Sep 17 00:00:00 2001 From: Yakov Lerner Date: Fri, 25 Sep 2009 15:10:21 -0700 Subject: [PATCH 03/17] send-email: fix obscure error when encryption=tls and smtp cannot connect When encryption=tls and we cannot connect to the SMTP server, git-send-email was printing an obtuse perl error: Can't call method "command" on an undefined value at git-send-email line 927. This can occur when smtp host or port is misspelled, or the network is down, and encryption has been set to tls. Instead we expect some familiar "Cannot connect to SERVER:PORT" message. Fix it to print normal "smtp can't connect" diagnostics. Signed-off-by: Yakov Lerner Signed-off-by: Shawn O. Pearce --- git-send-email.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-send-email.perl b/git-send-email.perl index 0700d80afc..dd821f70cd 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -921,7 +921,7 @@ X-Mailer: git-send-email $gitversion $smtp ||= Net::SMTP->new((defined $smtp_server_port) ? "$smtp_server:$smtp_server_port" : $smtp_server); - if ($smtp_encryption eq 'tls') { + if ($smtp_encryption eq 'tls' && $smtp) { require Net::SMTP::SSL; $smtp->command('STARTTLS'); $smtp->response(); From 5bdc32d3e50d8335c65e136e6b5234c5dd92a7a9 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 25 Sep 2009 23:54:42 -0400 Subject: [PATCH 04/17] make 'git clone' ask the remote only for objects it cares about Current behavior of 'git clone' when not using --mirror is to fetch everything from the peer, and then filter out unwanted refs just before writing them out to the cloned repository. This may become highly inefficient if the peer has an unusual ref namespace, or if it simply has "remotes" refs of its own, and those locally unwanted refs are connecting to a large set of objects which becomes unreferenced as soon as they are fetched. Let's filter out those unwanted refs from the peer _before_ asking it what refs we want to fetch instead, which is the most logical thing to do anyway. Signed-off-by: Nicolas Pitre Signed-off-by: Shawn O. Pearce --- builtin-clone.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin-clone.c b/builtin-clone.c index bab2d84ea1..4992c2597c 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -329,24 +329,28 @@ static void remove_junk_on_signal(int signo) raise(signo); } -static struct ref *write_remote_refs(const struct ref *refs, - struct refspec *refspec, const char *reflog) +static struct ref *wanted_peer_refs(const struct ref *refs, + struct refspec *refspec) { struct ref *local_refs = NULL; struct ref **tail = &local_refs; - struct ref *r; get_fetch_map(refs, refspec, &tail, 0); if (!option_mirror) get_fetch_map(refs, tag_refspec, &tail, 0); + return local_refs; +} + +static void write_remote_refs(const struct ref *local_refs) +{ + const struct ref *r; + for (r = local_refs; r; r = r->next) add_extra_ref(r->peer_ref->name, r->old_sha1, 0); pack_refs(PACK_REFS_ALL); clear_extra_refs(); - - return local_refs; } int cmd_clone(int argc, const char **argv, const char *prefix) @@ -495,9 +499,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix) strbuf_reset(&value); - if (path && !is_bundle) + if (path && !is_bundle) { refs = clone_local(path, git_dir); - else { + mapped_refs = wanted_peer_refs(refs, refspec); + } else { struct remote *remote = remote_get(argv[0]); transport = transport_get(remote, remote->url[0]); @@ -520,14 +525,16 @@ int cmd_clone(int argc, const char **argv, const char *prefix) option_upload_pack); refs = transport_get_remote_refs(transport); - if (refs) - transport_fetch_refs(transport, refs); + if (refs) { + mapped_refs = wanted_peer_refs(refs, refspec); + transport_fetch_refs(transport, mapped_refs); + } } if (refs) { clear_extra_refs(); - mapped_refs = write_remote_refs(refs, refspec, reflog_msg.buf); + write_remote_refs(mapped_refs); remote_head = find_ref_by_name(refs, "HEAD"); remote_head_points_at = From 6bbfd1fa98b0c1fa1684bd35e64404799f0cc2b3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 25 Sep 2009 20:44:44 +0200 Subject: [PATCH 05/17] parse-opt: ignore negation of OPT_NONEG for ambiguity checks parse_long_opt always matches both --opt and --no-opt for any option "opt", and only get_value checks whether --no-opt is actually valid. Since the options for git branch contains both "no-merged" and "merged" there are two matches for --no-merge, but no exact match. With this patch the negation of a NONEG option is rejected earlier, but it changes the error message from "option `no-opt' isn't available" to "unknown option `no-opt'". [jk: added test] Signed-off-by: Andreas Schwab Signed-off-by: Jeff King Signed-off-by: Shawn O. Pearce --- parse-options.c | 3 +++ t/t0040-parse-options.sh | 20 ++++++++++++++++++++ test-parse-options.c | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/parse-options.c b/parse-options.c index a64a4d6ee2..f5594114ed 100644 --- a/parse-options.c +++ b/parse-options.c @@ -230,6 +230,9 @@ is_abbreviated: abbrev_flags = flags; continue; } + /* negation allowed? */ + if (options->flags & PARSE_OPT_NONEG) + continue; /* negated and abbreviated very much? */ if (!prefixcmp("no-", arg)) { flags |= OPT_UNSET; diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index bbc821ef97..3d450ed379 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -33,6 +33,8 @@ Magic arguments --quux means --quux -NUM set integer to NUM + same as -b + --ambiguous positive ambiguity + --no-ambiguous negative ambiguity Standard options --abbrev[=] use digits to display SHA-1s @@ -315,4 +317,22 @@ test_expect_success 'OPT_NUMBER_CALLBACK() works' ' test_cmp expect output ' +cat >expect <output 2>output.err && + test ! -s output.err && + test_cmp expect output +' + test_done diff --git a/test-parse-options.c b/test-parse-options.c index efa734b42e..acd1a2ba70 100644 --- a/test-parse-options.c +++ b/test-parse-options.c @@ -8,6 +8,7 @@ static int abbrev = 7; static int verbose = 0, dry_run = 0, quiet = 0; static char *string = NULL; static char *file = NULL; +static int ambiguous; static int length_callback(const struct option *opt, const char *arg, int unset) { @@ -59,6 +60,10 @@ int main(int argc, const char **argv) number_callback), { OPTION_BOOLEAN, '+', NULL, &boolean, NULL, "same as -b", PARSE_OPT_NOARG | PARSE_OPT_NONEG | PARSE_OPT_NODASH }, + { OPTION_BOOLEAN, 0, "ambiguous", &ambiguous, NULL, + "positive ambiguity", PARSE_OPT_NOARG | PARSE_OPT_NONEG }, + { OPTION_BOOLEAN, 0, "no-ambiguous", &ambiguous, NULL, + "negative ambiguity", PARSE_OPT_NOARG | PARSE_OPT_NONEG }, OPT_GROUP("Standard options"), OPT__ABBREV(&abbrev), OPT__VERBOSE(&verbose), From 1b018fd9be290fd6a70ce3093ab1dc1abce74e00 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 27 Sep 2009 01:15:09 +0200 Subject: [PATCH 06/17] git branch -D: give a better error message when lockfile creation fails Previously the old error message just told the user that it was not possible to delete the ref from the packed-refs file. Give instructions on how to resolve the problem. Signed-off-by: Miklos Vajna Signed-off-by: Jeff King Signed-off-by: Shawn O. Pearce --- cache.h | 1 + lockfile.c | 26 ++++++++++++++++++++------ refs.c | 4 +++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/cache.h b/cache.h index 1a6412dfd6..a5eeead1e2 100644 --- a/cache.h +++ b/cache.h @@ -489,6 +489,7 @@ struct lock_file { }; #define LOCK_DIE_ON_ERROR 1 #define LOCK_NODEREF 2 +extern int unable_to_lock_error(const char *path, int err); extern NORETURN void unable_to_lock_index_die(const char *path, int err); extern int hold_lock_file_for_update(struct lock_file *, const char *path, int); extern int hold_lock_file_for_append(struct lock_file *, const char *path, int); diff --git a/lockfile.c b/lockfile.c index eb931eded5..6851fa55a5 100644 --- a/lockfile.c +++ b/lockfile.c @@ -155,18 +155,32 @@ static int lock_file(struct lock_file *lk, const char *path, int flags) return lk->fd; } - -NORETURN void unable_to_lock_index_die(const char *path, int err) +static char *unable_to_lock_message(const char *path, int err) { + struct strbuf buf = STRBUF_INIT; + if (err == EEXIST) { - die("Unable to create '%s.lock': %s.\n\n" + strbuf_addf(&buf, "Unable to create '%s.lock': %s.\n\n" "If no other git process is currently running, this probably means a\n" "git process crashed in this repository earlier. Make sure no other git\n" "process is running and remove the file manually to continue.", path, strerror(err)); - } else { - die("Unable to create '%s.lock': %s", path, strerror(err)); - } + } else + strbuf_addf(&buf, "Unable to create '%s.lock': %s", path, strerror(err)); + return strbuf_detach(&buf, NULL); +} + +int unable_to_lock_error(const char *path, int err) +{ + char *msg = unable_to_lock_message(path, err); + error("%s", msg); + free(msg); + return -1; +} + +NORETURN void unable_to_lock_index_die(const char *path, int err) +{ + die("%s", unable_to_lock_message(path, err)); } int hold_lock_file_for_update(struct lock_file *lk, const char *path, int flags) diff --git a/refs.c b/refs.c index 24865cf5a6..808f56bb27 100644 --- a/refs.c +++ b/refs.c @@ -972,8 +972,10 @@ static int repack_without_ref(const char *refname) if (!found) return 0; fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0); - if (fd < 0) + if (fd < 0) { + unable_to_lock_error(git_path("packed-refs"), errno); return error("cannot delete '%s' from packed refs", refname); + } for (list = packed_ref_list; list; list = list->next) { char line[PATH_MAX + 100]; From 42a0ea94ce661a069f0622f6c01d1d1f21cbbc18 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Mon, 28 Sep 2009 10:25:55 +0200 Subject: [PATCH 07/17] Correct minor typo in post-receive hook template Signed-off-by: Shawn O. Pearce --- templates/hooks--post-receive.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/hooks--post-receive.sample b/templates/hooks--post-receive.sample index 18d2e0f727..7a83e17ab5 100755 --- a/templates/hooks--post-receive.sample +++ b/templates/hooks--post-receive.sample @@ -9,7 +9,7 @@ # For example: # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master # -# see contrib/hooks/ for an sample, or uncomment the next line and +# see contrib/hooks/ for a sample, or uncomment the next line and # rename the file to "post-receive". #. /usr/share/doc/git-core/contrib/hooks/post-receive-email From c9486ae847d346da44f3bd1aa964520a52d48e2a Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Mon, 28 Sep 2009 09:56:00 -0500 Subject: [PATCH 08/17] Documentation/git-gc.txt: default --aggressive window is 250, not 10 The default --aggressive window has been 250 since 1c192f34 "gc --aggressive: make it really aggressive", released in git v1.6.3. Signed-off-by: Brandon Casey Signed-off-by: Shawn O. Pearce --- Documentation/git-gc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index dcac8c8e29..1f6df6ad6b 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -106,7 +106,7 @@ much time is spent optimizing the delta compression of the objects in the repository when the --aggressive option is specified. The larger the value, the more time is spent optimizing the delta compression. See the documentation for the --window' option in linkgit:git-repack[1] for -more details. This defaults to 10. +more details. This defaults to 250. The optional configuration variable 'gc.pruneExpire' controls how old the unreferenced loose objects have to be before they are pruned. The From 0484682ef326db0d3b99e71f6ca4551d0f5a4609 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 29 Sep 2009 07:42:25 +0200 Subject: [PATCH 09/17] typo fix: Directory `...' exist, ...: s/exist/exists/ Signed-off-by: Jim Meyering Signed-off-by: Shawn O. Pearce --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-submodule.sh b/git-submodule.sh index bfbd36b6f4..0462e529d9 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -98,7 +98,7 @@ module_clone() if test -d "$path" then rmdir "$path" 2>/dev/null || - die "Directory '$path' exist, but is neither empty nor a git repository" + die "Directory '$path' exists, but is neither empty nor a git repository" fi test -e "$path" && From 6f798b9590ca3a26d6c8e9318929eefef9b640f2 Mon Sep 17 00:00:00 2001 From: Michael Wookey Date: Mon, 28 Sep 2009 20:46:52 +1000 Subject: [PATCH 10/17] generators/vcproj.pm: remove UNICODE from build Defining UNICODE for MSVC IDE builds results in certain Win32 WIDE API's receiving ANSI strings. The result of which is an invalid use of the API and will end in either data corruption or an application crash. Prevent the use of WIDE API's when building with the MSVC IDE for compatibility with msysGit. Signed-off-by: Michael Wookey Acked-by: Marius Storm-Olsen Signed-off-by: Shawn O. Pearce --- contrib/buildsystems/Generators/Vcproj.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm index 00ec0c1369..a21591109e 100644 --- a/contrib/buildsystems/Generators/Vcproj.pm +++ b/contrib/buildsystems/Generators/Vcproj.pm @@ -173,7 +173,7 @@ sub createLibProject { Optimization="0" InlineFunctionExpansion="1" AdditionalIncludeDirectories="$includes" - PreprocessorDefinitions="UNICODE,WIN32,_DEBUG,$defines" + PreprocessorDefinitions="WIN32,_DEBUG,$defines" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -239,7 +239,7 @@ sub createLibProject { InlineFunctionExpansion="1" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$includes" - PreprocessorDefinitions="UNICODE,WIN32,NDEBUG,$defines" + PreprocessorDefinitions="WIN32,NDEBUG,$defines" RuntimeLibrary="0" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -395,7 +395,7 @@ sub createAppProject { Optimization="0" InlineFunctionExpansion="1" AdditionalIncludeDirectories="$includes" - PreprocessorDefinitions="UNICODE,WIN32,_DEBUG,$defines" + PreprocessorDefinitions="WIN32,_DEBUG,$defines" MinimalRebuild="true" RuntimeLibrary="1" UsePrecompiledHeader="0" @@ -466,7 +466,7 @@ sub createAppProject { InlineFunctionExpansion="1" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="$includes" - PreprocessorDefinitions="UNICODE,WIN32,NDEBUG,$defines" + PreprocessorDefinitions="WIN32,NDEBUG,$defines" RuntimeLibrary="0" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" From 76031f191e5ea340f0a1501125891ae0fed76ff7 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 28 Sep 2009 13:34:20 +0200 Subject: [PATCH 11/17] Make generated MSVC solution file open from Windows Explorer In order to be able to open the generated solution file by double- clicking it in Windows Explorer, all project files need to use DOS line-endings and a comment about the Visual Studio version needs to be added to the header of the solution file. This also fixes the icon that is displayed for the solution file in Windows Explorer. Note that opening the solution file from a running instance of Visual Studio already worked before. Signed-off-by: Sebastian Schuberth Acked-by: Marius Storm-Olsen Signed-off-by: Shawn O. Pearce --- contrib/buildsystems/Generators/Vcproj.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm index a21591109e..37f72e53ac 100644 --- a/contrib/buildsystems/Generators/Vcproj.pm +++ b/contrib/buildsystems/Generators/Vcproj.pm @@ -131,6 +131,7 @@ sub createLibProject { $includes =~ s/-I//g; mkdir "$target" || die "Could not create the directory $target for lib project!\n"; open F, ">$target/$target.vcproj" || die "Could not open $target/$target.pro for writing!\n"; + binmode F, ":crlf"; print F << "EOM"; $target/$target.vcproj" || die "Could not open $target/$target.pro for writing!\n"; + binmode F, ":crlf"; print F << "EOM"; git.sln" || die "Could not open git.sln for writing!\n"; + binmode F, ":crlf"; print F "$SLN_HEAD"; foreach (@libs) { my $libname = $_; From e0ab002b5093e87f06871d7e25ac03e26841d355 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 28 Sep 2009 13:34:21 +0200 Subject: [PATCH 12/17] Make just opening the generated MSVC solution file not modify it The format of the generated MSVC solution file is fixed in a way that just opening it in Visual Studio and immediately closing it again without performing any modifications does not trigger a prompt to save the solution file. This behavior was caused by several minor incompatibilities between the generated file and what Visual Studio 2008 expected, so Visual Studio transparently fixed the file format, marking it internally as modified. Signed-off-by: Sebastian Schuberth Acked-by: Marius Storm-Olsen Signed-off-by: Shawn O. Pearce --- contrib/buildsystems/Generators/Vcproj.pm | 42 ++++++----------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm index 37f72e53ac..be94ba18d2 100644 --- a/contrib/buildsystems/Generators/Vcproj.pm +++ b/contrib/buildsystems/Generators/Vcproj.pm @@ -571,45 +571,29 @@ sub createGlueProject { print F "\"${libname}\", \"${libname}\\${libname}.vcproj\", \"${uuid}\""; print F "$SLN_POST"; } + my $uuid_libgit = $build_structure{"LIBS_libgit_GUID"}; + my $uuid_xdiff_lib = $build_structure{"LIBS_xdiff_lib_GUID"}; foreach (@apps) { my $appname = $_; my $uuid = $build_structure{"APPS_${appname}_GUID"}; print F "$SLN_PRE"; - print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\""; + print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"\n"; + print F " ProjectSection(ProjectDependencies) = postProject\n"; + print F " ${uuid_libgit} = ${uuid_libgit}\n"; + print F " ${uuid_xdiff_lib} = ${uuid_xdiff_lib}\n"; + print F " EndProjectSection"; print F "$SLN_POST"; } print F << "EOM"; Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug|Win32 - ConfigName.1 = Release|Win32 + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution EOM - foreach (@{$build_structure{"APPS"}}) { - my $appname = $_; - my $appname_clean = $_; - $appname_clean =~ s/\//_/g; - $appname_clean =~ s/\.exe//; - - my $uuid = $build_structure{"APPS_${appname_clean}_GUID"}; - my $dep_index = 0; - foreach(@{$build_structure{"APPS_${appname}_LIBS"}}) { - my $libname = $_; - $libname =~ s/\//_/g; - $libname =~ s/\.(a|lib)//; - my $libuuid = $build_structure{"LIBS_${libname}_GUID"}; - if (defined $libuuid) { - print F "\t\t${uuid}.${dep_index} = ${libuuid}\n"; - $dep_index += 1; - } - } - } - print F << "EOM"; - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution + GlobalSection(ProjectConfigurationPlatforms) = postSolution EOM foreach (@libs) { my $libname = $_; @@ -630,10 +614,6 @@ EOM print F << "EOM"; EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection EndGlobal EOM close F; From 1be224ba6e99f0ab34c998d7fa8023b76a15c8b6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 28 Sep 2009 23:40:08 -0700 Subject: [PATCH 13/17] builtin-mailinfo.c: check error status from rewind and ftruncate A recent "cut at scissors" implementation rewinds and truncates the output file to store the message when it sees a scissors mark, but it did not check if these library calls succeeded. Signed-off-by: Junio C Hamano [sp: Use fseek as rewind returns void] Signed-off-by: Shawn O. Pearce --- builtin-mailinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index d498b1cd2d..c90cd312ac 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -785,8 +785,10 @@ static int handle_commit_msg(struct strbuf *line) if (use_scissors && is_scissors_line(line)) { int i; - rewind(cmitmsg); - ftruncate(fileno(cmitmsg), 0); + if (fseek(cmitmsg, 0L, SEEK_SET)) + die_errno("Could not rewind output message file"); + if (ftruncate(fileno(cmitmsg), 0)) + die_errno("Could not truncate output message file at scissors"); still_looking = 1; /* From 5322ef2006cc93ad76140ff742cd96e74c1ec09b Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Wed, 30 Sep 2009 19:49:24 +0100 Subject: [PATCH 14/17] Fix some printf format warnings commit 51ea551 ("make sure byte swapping is optimal for git" 2009-08-18) introduced a "sane definition for ntohl()/htonl()" for use on some GNU C platforms. Unfortunately, for some of these platforms, this results in the introduction of a problem which is essentially the reverse of a problem that commit 6e1c234 ("Fix some warnings (on cygwin) to allow -Werror" 2008-07-3) was intended to fix. In particular, on platforms where the uint32_t type is defined to be unsigned long, the return type of the new ntohl()/htonl() is causing gcc to issue printf format warnings, such as: warning: long unsigned int format, unsigned int arg (arg 3) (nine such warnings, covering six different files). The earlier commit (6e1c234) needed to suppress these same warnings, except that the types were in the opposite direction; namely the format specifier ("%u") was 'unsigned int' and the argument type (ie the return type of ntohl()) was 'long unsigned int' (aka uint32_t). In order to suppress these warnings, the earlier commit used the (C99) PRIu32 format specifier, since the definition of this macro is suitable for use with the uint32_t type on that platform. This worked because the return type of the (original) platform ntohl()/htonl() functions was uint32_t. In order to suppress these warnings, we change the return type of the new byte swapping functions in the compat/bswap.h header file from 'unsigned int' to uint32_t. Signed-off-by: Ramsay Jones Acked-by: Nicolas Pitre Signed-off-by: Jeff King --- compat/bswap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compat/bswap.h b/compat/bswap.h index 7246a12c6e..5cc4acbfcc 100644 --- a/compat/bswap.h +++ b/compat/bswap.h @@ -9,7 +9,7 @@ * Default version that the compiler ought to optimize properly with * constant values. */ -static inline unsigned int default_swab32(unsigned int val) +static inline uint32_t default_swab32(uint32_t val) { return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | @@ -20,7 +20,7 @@ static inline unsigned int default_swab32(unsigned int val) #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define bswap32(x) ({ \ - unsigned int __res; \ + uint32_t __res; \ if (__builtin_constant_p(x)) { \ __res = default_swab32(x); \ } else { \ From e3679ab4a80b7c6e1eb83f3540cff72ff6426b09 Mon Sep 17 00:00:00 2001 From: Adam Brewster Date: Thu, 1 Oct 2009 20:52:11 -0400 Subject: [PATCH 15/17] filter-branch: add --prune-empty to option summary Signed-off-by: Adam Brewster Signed-off-by: Jeff King --- Documentation/git-filter-branch.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 32ea8564a5..2b40babb6b 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -12,6 +12,7 @@ SYNOPSIS [--index-filter ] [--parent-filter ] [--msg-filter ] [--commit-filter ] [--tag-name-filter ] [--subdirectory-filter ] + [--prune-empty] [--original ] [-d ] [-f | --force] [--] [...] From b4ae5e2ac4651097d0f2916f8e566f955a8fa586 Mon Sep 17 00:00:00 2001 From: Mark Rada Date: Thu, 1 Oct 2009 21:59:20 -0400 Subject: [PATCH 16/17] tests: make all test files executable For consistency with the rest of the test files. Signed-off-by: Mark Rada Signed-off-by: Jeff King --- t/t5531-deep-submodule-push.sh | 0 t/t9501-gitweb-standalone-http-status.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 t/t5531-deep-submodule-push.sh mode change 100644 => 100755 t/t9501-gitweb-standalone-http-status.sh diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh old mode 100644 new mode 100755 diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh old mode 100644 new mode 100755 From dbc1b1f71052c084a84b5c395e1cb4b5ae526fcb Mon Sep 17 00:00:00 2001 From: Johan Sageryd Date: Sat, 3 Oct 2009 13:20:18 +0900 Subject: [PATCH 17/17] Fix '--relative-date' This fixes '--relative-date' so that it does not give '0 year, 12 months', for the interval 360 <= diff < 365. Signed-off-by: Johan Sageryd Signed-off-by: Jeff King --- date.c | 2 +- t/t0006-date.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/date.c b/date.c index e9ee4aa748..5d05ef61cf 100644 --- a/date.c +++ b/date.c @@ -123,7 +123,7 @@ const char *show_date_relative(unsigned long time, int tz, return timebuf; } /* Say months for the past 12 months or so */ - if (diff < 360) { + if (diff < 365) { snprintf(timebuf, timebuf_size, "%lu months ago", (diff + 15) / 30); return timebuf; } diff --git a/t/t0006-date.sh b/t/t0006-date.sh index a4d8fa8fa1..75b02af86d 100755 --- a/t/t0006-date.sh +++ b/t/t0006-date.sh @@ -24,6 +24,7 @@ check_show 13000000 '5 months ago' check_show 37500000 '1 year, 2 months ago' check_show 55188000 '1 year, 9 months ago' check_show 630000000 '20 years ago' +check_show 31449600 '12 months ago' check_parse() { echo "$1 -> $2" >expect