From da1fbed3fff6ed2d64399ff26d8a9ab3bcf00540 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 30 Mar 2010 19:36:03 +0200 Subject: [PATCH 1/9] diff: fix textconv error zombies To make the code simpler, run_textconv lumps all of its error checking into one conditional. However, the short-circuit means that an error in reading will prevent us from calling finish_command, leaving a zombie child. Clean up properly after errors. Based-on-work-by: Jeff King Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- diff.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index 0d465faa1e..99059231b4 100644 --- a/diff.c +++ b/diff.c @@ -3865,6 +3865,7 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec, const char **arg = argv; struct child_process child; struct strbuf buf = STRBUF_INIT; + int err = 0; temp = prepare_temp_file(spec->path, spec); *arg++ = pgm; @@ -3875,16 +3876,20 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec, child.use_shell = 1; child.argv = argv; child.out = -1; - if (start_command(&child) != 0 || - strbuf_read(&buf, child.out, 0) < 0 || - finish_command(&child) != 0) { - close(child.out); - strbuf_release(&buf); + if (start_command(&child)) { remove_tempfile(); - error("error running textconv command '%s'", pgm); return NULL; } + + if (strbuf_read(&buf, child.out, 0) < 0) + err = error("error reading from textconv command '%s'", pgm); close(child.out); + + if (finish_command(&child) || err) { + strbuf_release(&buf); + remove_tempfile(); + return NULL; + } remove_tempfile(); return strbuf_detach(&buf, outsize); From 852f098c0667abc634f5aba0b91e0317f714fa67 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 30 Mar 2010 09:46:23 +0200 Subject: [PATCH 2/9] Windows: fix utime() for read-only files Starting with 5256b00 (Use git_mkstemp_mode instead of plain mkstemp to create object files, 2010-02-22) utime() is invoked on read-only files. This is not allowed on Windows and results in many warnings of the form failed utime() on .git/objects/23/tmp_obj_VlgHlc: Permission denied during a repack. Fix it by making the file temporarily writable. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- compat/mingw.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index ab65f77ab9..59b18dc7ca 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -259,8 +259,17 @@ int mingw_utime (const char *file_name, const struct utimbuf *times) int fh, rc; /* must have write permission */ - if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) - return -1; + DWORD attrs = GetFileAttributes(file_name); + if (attrs != INVALID_FILE_ATTRIBUTES && + (attrs & FILE_ATTRIBUTE_READONLY)) { + /* ignore errors here; open() will report them */ + SetFileAttributes(file_name, attrs & ~FILE_ATTRIBUTE_READONLY); + } + + if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) { + rc = -1; + goto revert_attrs; + } time_t_to_filetime(times->modtime, &mft); time_t_to_filetime(times->actime, &aft); @@ -270,6 +279,13 @@ int mingw_utime (const char *file_name, const struct utimbuf *times) } else rc = 0; close(fh); + +revert_attrs: + if (attrs != INVALID_FILE_ATTRIBUTES && + (attrs & FILE_ATTRIBUTE_READONLY)) { + /* ignore errors again */ + SetFileAttributes(file_name, attrs); + } return rc; } From 09f53b16bc65e14b116a275b3c569b2aa8040ad8 Mon Sep 17 00:00:00 2001 From: Greg Bacon Date: Tue, 30 Mar 2010 12:20:57 -0500 Subject: [PATCH 3/9] Documentation: Clarify support for smart HTTP backend In the description of http.getanyfile, replace the vague "older Git clients" with the earliest release whose client is able to use the upload pack service. Signed-off-by: Greg Bacon Signed-off-by: Junio C Hamano --- Documentation/git-http-backend.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt index 5238820657..277d9e141b 100644 --- a/Documentation/git-http-backend.txt +++ b/Documentation/git-http-backend.txt @@ -35,7 +35,7 @@ These services can be enabled/disabled using the per-repository configuration file: http.getanyfile:: - This serves older Git clients which are unable to use the + This serves Git clients older than version 1.6.6 that are unable to use the upload pack service. When enabled, clients are able to read any file within the repository, including objects that are no longer reachable from a branch but are still present. From e4762865c88050745a20a62c64b4ffa542e88c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20St=C4=99pie=C5=84?= Date: Wed, 31 Mar 2010 11:24:19 +0200 Subject: [PATCH 4/9] Updated the usage string of git reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make git reset usage string reflect the command's behaviour and contents of the man page. Signed-off-by: Jan Stępień Signed-off-by: Junio C Hamano --- builtin-reset.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-reset.c b/builtin-reset.c index 0f5022eed2..a174a31610 100644 --- a/builtin-reset.c +++ b/builtin-reset.c @@ -23,7 +23,8 @@ static const char * const git_reset_usage[] = { "git reset [--mixed | --soft | --hard | --merge] [-q] []", - "git reset [--mixed] [--] ...", + "git reset [-q] [--] ...", + "git reset --patch [] [--] [...]", NULL }; From 7a49c254cdaec6b15a6e2818e29fdb34fc6f7717 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Sat, 27 Mar 2010 20:26:59 +0100 Subject: [PATCH 5/9] gitweb: git_get_project_config requires only $git_dir, not also $project Fix overeager early return in git_get_project_config, introduced in 9be3614 (gitweb: Fix project-specific feature override behavior, 2010-03-01). When git_get_project_config is called from projects list page via git_get_project_owner($path) etc., it is called with $git_dir defined (in git_get_project_owner($path) etc.), but $project variable is not defined. git_get_project_config doesn't use $project variable anyway. Reported-by: Tobias Heinlein Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 3d80deba01..9d4c58238e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2209,8 +2209,7 @@ sub config_to_multi { sub git_get_project_config { my ($key, $type) = @_; - # do we have project - return unless (defined $project && defined $git_dir); + return unless defined $git_dir; # key sanity check return unless ($key); From 21e403a7b956a95a36f218439f82b1c8af869257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 29 Mar 2010 12:22:19 +0200 Subject: [PATCH 6/9] Don't redefine htonl and ntohl on big-endian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit 0fcabdeb52b79775173d009ccc179db104dfbb66, compat/bswap.h redefined htonl and ntohl to bswap32 not only if bswap32 has been defined earlier in compat/bswap.h (which is done only on selected platforms), but also if bswap32 has been defined anywhere else. This broke Git at least for NetBSD systems running on big-endian machines (where ntohl and htonl should, of course, be NOOPs), since NetBSD defines a bswap32 macro in the system headers. So, we now undefine any previously defined bswap32 in compat/bswap.h before defining our own. Signed-off-by: Holger Weiß Signed-off-by: Junio C Hamano --- compat/bswap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compat/bswap.h b/compat/bswap.h index f3b8c44181..54756dbb05 100644 --- a/compat/bswap.h +++ b/compat/bswap.h @@ -17,6 +17,8 @@ static inline uint32_t default_swab32(uint32_t val) ((val & 0x000000ff) << 24)); } +#undef bswap32 + #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define bswap32(x) ({ \ From 21704227904b51197976c61c595b52d807677533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 29 Mar 2010 12:57:48 +0200 Subject: [PATCH 7/9] Link against libiconv on IRIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On IRIX, "-liconv" must be added to the linker command line in order to get iconv(3) support; set the according Makefile variable appropriately. Signed-off-by: Holger Weiß Signed-off-by: Junio C Hamano --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 98372ebbfc..b07cd8a681 100644 --- a/Makefile +++ b/Makefile @@ -886,6 +886,7 @@ ifeq ($(uname_S),IRIX) SNPRINTF_RETURNS_BOGUS = YesPlease SHELL_PATH = /usr/gnu/bin/bash NEEDS_LIBGEN = YesPlease + NEEDS_LIBICONV = YesPlease endif ifeq ($(uname_S),IRIX64) NO_SETENV=YesPlease @@ -904,6 +905,7 @@ ifeq ($(uname_S),IRIX64) SNPRINTF_RETURNS_BOGUS = YesPlease SHELL_PATH=/usr/gnu/bin/bash NEEDS_LIBGEN = YesPlease + NEEDS_LIBICONV = YesPlease endif ifeq ($(uname_S),HP-UX) NO_IPV6=YesPlease From 4318d3ba8fcb136a6ba3beaebaac8f47086bbf5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 29 Mar 2010 13:02:37 +0200 Subject: [PATCH 8/9] Documentation: show-ref s are optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifying one or more parameters is optional when calling show-ref, so mark them as such using brackets in the manual. Signed-off-by: Holger Weiß Signed-off-by: Junio C Hamano --- Documentation/git-show-ref.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt index df17d49b87..3f9d9c6db3 100644 --- a/Documentation/git-show-ref.txt +++ b/Documentation/git-show-ref.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference] [-s|--hash[=]] [--abbrev[=]] [--tags] - [--heads] [--] ... + [--heads] [--] [...] 'git show-ref' --exclude-existing[=] < ref-list DESCRIPTION From 2be10bb5c1cfe15aa4f1b43137ccd17d826d8553 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 31 Mar 2010 15:12:08 -0700 Subject: [PATCH 9/9] Git 1.7.0.4 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.7.0.4.txt | 12 ++++++++++-- Documentation/git.txt | 3 ++- GIT-VERSION-GEN | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Documentation/RelNotes-1.7.0.4.txt b/Documentation/RelNotes-1.7.0.4.txt index cbc94a2f08..cf7f60e60d 100644 --- a/Documentation/RelNotes-1.7.0.4.txt +++ b/Documentation/RelNotes-1.7.0.4.txt @@ -1,9 +1,11 @@ -Git v1.7.0.4 Release Notes (draft) -================================== +Git v1.7.0.4 Release Notes +========================== Fixes since v1.7.0.3 -------------------- + * Optimized ntohl/htonl on big-endian machines were broken. + * Color values given to "color.." configuration can now have more than one attributes (e.g. "bold ul"). @@ -16,4 +18,10 @@ Fixes since v1.7.0.3 * "git fast-export" didn't check error status and stop when marks file cannot be opened. + * "git format-patch --ignore-if-in-upstream" gave unwarranted errors + when the range was empty, instead of silently finishing. + + * "git remote prune" did not detect remote tracking refs that became + dangling correctly. + And other minor fixes and documentation updates. diff --git a/Documentation/git.txt b/Documentation/git.txt index 4e00b315ff..657eac831c 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.7.0.3/git.html[documentation for release 1.7.0.3] +* link:v1.7.0.4/git.html[documentation for release 1.7.0.4] * release notes for + link:RelNotes-1.7.0.4.txt[1.7.0.4], link:RelNotes-1.7.0.3.txt[1.7.0.3], link:RelNotes-1.7.0.2.txt[1.7.0.2], link:RelNotes-1.7.0.1.txt[1.7.0.1], diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 076c18ecc3..3eb6d8517e 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.0.3 +DEF_VER=v1.7.0.4 LF=' '