From 81035bba0a15f9c8c28016c131dda864b70774f3 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Sat, 3 Mar 2007 18:28:14 +0100 Subject: Fix git-gc usage note Signed-off-by: Matthias Kestenholz Signed-off-by: Junio C Hamano --- git-gc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-gc.sh b/git-gc.sh index 1a45de5df..436d7caff 100755 --- a/git-gc.sh +++ b/git-gc.sh @@ -4,7 +4,7 @@ # # Cleanup unreachable files and optimize the repository. -USAGE='git-gc [--prune]' +USAGE='[--prune]' SUBDIRECTORY_OK=Yes . git-sh-setup -- cgit v1.2.1 From 64edf4b2eb19e5b94eda60c0e21d85e45602a8f1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 3 Mar 2007 17:14:25 +0100 Subject: builtin-archive: use RUN_SETUP It used to roll its own setup. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-archive.c | 2 -- git.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/builtin-archive.c b/builtin-archive.c index f613ac251..5265764b6 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -252,8 +252,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix) memset(&ar, 0, sizeof(ar)); tree_idx = parse_archive_args(argc, argv, &ar); - if (prefix == NULL) - prefix = setup_git_directory(); argv += tree_idx; parse_treeish_arg(argv, &ar.args, prefix); diff --git a/git.c b/git.c index 45265f14d..660b0a6dc 100644 --- a/git.c +++ b/git.c @@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "add", cmd_add, RUN_SETUP | NOT_BARE }, { "annotate", cmd_annotate, USE_PAGER }, { "apply", cmd_apply }, - { "archive", cmd_archive }, + { "archive", cmd_archive, RUN_SETUP }, { "blame", cmd_blame, RUN_SETUP }, { "branch", cmd_branch, RUN_SETUP }, { "cat-file", cmd_cat_file, RUN_SETUP }, -- cgit v1.2.1 From 7d79c860a6e2a8ceee10039153b47f0a8580607d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 3 Mar 2007 13:04:54 -0800 Subject: git-merge: fail correctly when we cannot fast forward. When we cannot fast forward the working tree and the current branch, git-merge did not exit with non-zero status. Noticed by Larry Streepy, the section to be fixed identfied by Johannes Schindelin. Signed-off-by: Junio C Hamano --- git-merge.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-merge.sh b/git-merge.sh index 498c938c4..4afcd9531 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -294,7 +294,7 @@ f,*) git-update-index --refresh 2>/dev/null new_head=$(git-rev-parse --verify "$1^0") && git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" && - finish "$new_head" "Fast forward" + finish "$new_head" "Fast forward" || exit dropsave exit 0 ;; -- cgit v1.2.1 From 78cb59c8e5b5ac6ab709b8544698e13511759a76 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 4 Mar 2007 00:17:23 +0100 Subject: Document the config variable format.suffix Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/config.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index 9fec76935..d9c12f14b 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -340,6 +340,11 @@ format.headers:: Additional email headers to include in a patch to be submitted by mail. See gitlink:git-format-patch[1]. +format.suffix:: + The default for format-patch is to output files with the suffix + `.patch`. Use this variable to change that suffix (make sure to + include the dot if you want it). + gc.packrefs:: `git gc` does not run `git pack-refs` in a bare repository by default so that older dumb-transport clients can still fetch -- cgit v1.2.1 From ee96d11bebcbb4826f9b59b5dca64e2b8a204bc0 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 3 Mar 2007 18:28:46 +0000 Subject: Fix a "label defined but unreferenced" warning. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- refs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/refs.c b/refs.c index 638770378..a9b8c72c6 100644 --- a/refs.c +++ b/refs.c @@ -1042,7 +1042,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master, return -1; } +#ifndef NO_SYMLINK_HEAD done: +#endif if (logmsg && !read_ref(refs_heads_master, new_sha1)) log_ref_write(ref_target, old_sha1, new_sha1, logmsg); -- cgit v1.2.1 From 41b200179dfac7bf4c3b98270951937b537e2b24 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 3 Mar 2007 18:28:52 +0000 Subject: Fix an "implicit function definition" warning. The function at issue being initgroups() from the header file. On Cygwin, setting _XOPEN_SOURCE suppresses the definition of initgroups(), which causes the warning while compiling daemon.c. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- git-compat-util.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 9863cf671..309240bbc 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -47,9 +47,15 @@ #include #include #include +#if defined(__CYGWIN__) +#undef _XOPEN_SOURCE +#include +#define _XOPEN_SOURCE 600 +#else #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */ #include #define _ALL_SOURCE 1 +#endif #ifndef NO_ICONV #include -- cgit v1.2.1 From 2832114532d92bdd533f84fa520050c5de95c012 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 3 Mar 2007 18:28:57 +0000 Subject: Fix some "comparison is always true/false" warnings. On Cygwin the wchar_t type is an unsigned short (16-bit) int. This results in the above warnings from the return statement in the wcwidth() function (in particular, the expressions involving constants with values larger than 0xffff). Simply replace the use of wchar_t with an unsigned int, typedef-ed as ucs_char_t. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- utf8.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utf8.c b/utf8.c index 7c80eeccb..211e100b9 100644 --- a/utf8.c +++ b/utf8.c @@ -3,13 +3,15 @@ /* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */ +typedef unsigned int ucs_char_t; /* assuming 32bit int */ + struct interval { int first; int last; }; /* auxiliary function for binary search in interval table */ -static int bisearch(wchar_t ucs, const struct interval *table, int max) { +static int bisearch(ucs_char_t ucs, const struct interval *table, int max) { int min = 0; int mid; @@ -56,11 +58,11 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) { * ISO 8859-1 and WGL4 characters, Unicode control characters, * etc.) have a column width of 1. * - * This implementation assumes that wchar_t characters are encoded + * This implementation assumes that ucs_char_t characters are encoded * in ISO 10646. */ -static int wcwidth(wchar_t ch) +static int wcwidth(ucs_char_t ch) { /* * Sorted list of non-overlapping intervals of non-spacing characters, @@ -157,7 +159,7 @@ static int wcwidth(wchar_t ch) int utf8_width(const char **start) { unsigned char *s = (unsigned char *)*start; - wchar_t ch; + ucs_char_t ch; if (*s < 0x80) { /* 0xxxxxxx */ -- cgit v1.2.1 From fd547a972ad1ad714e1dac0a9ffc7637a64dd9b2 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 3 Mar 2007 18:29:03 +0000 Subject: Fix a "pointer type missmatch" warning. In particular, the second parameter in the call to iconv() will cause this warning if your library declares iconv() with the second (input buffer pointer) parameter of type const char **. This is the old prototype, which is none-the-less used by the current version of newlib on Cygwin. (It appears in old versions of glibc too). Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- Makefile | 7 +++++++ utf8.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9f2cbe2cb..e18b007da 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,9 @@ all:: # # Define NO_ICONV if your libc does not properly support iconv. # +# Define OLD_ICONV if your library has an old iconv(), where the second +# (input buffer pointer) parameter is declared with type (const char **). +# # Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that # tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib" # is used instead. @@ -573,6 +576,10 @@ ifdef NO_ICONV BASIC_CFLAGS += -DNO_ICONV endif +ifdef OLD_ICONV + BASIC_CFLAGS += -DOLD_ICONV +endif + ifdef PPC_SHA1 SHA1_HEADER = "ppc/sha1.h" LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o diff --git a/utf8.c b/utf8.c index 211e100b9..f381a7f13 100644 --- a/utf8.c +++ b/utf8.c @@ -293,11 +293,17 @@ int is_encoding_utf8(const char *name) * with iconv. If the conversion fails, returns NULL. */ #ifndef NO_ICONV +#ifdef OLD_ICONV + typedef const char * iconv_ibp; +#else + typedef char * iconv_ibp; +#endif char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding) { iconv_t conv; size_t insz, outsz, outalloc; - char *out, *outpos, *cp; + char *out, *outpos; + iconv_ibp cp; if (!in_encoding) return NULL; @@ -309,7 +315,7 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e outalloc = outsz + 1; /* for terminating NUL */ out = xmalloc(outalloc); outpos = out; - cp = (char *)in; + cp = (iconv_ibp)in; while (1) { size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz); -- cgit v1.2.1 From 7943b3a94f0f862dc9d7dcec6b5639ae5bf027bd Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 3 Mar 2007 18:28:39 +0000 Subject: Unset NO_C99_FORMAT on Cygwin. This should only be set based on the capability of your compiler/library to support c99 format specifiers. In this case the version of gcc/newlib and indirectly the version of Cygwin. It should probably only be set in your config.mak file. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index e18b007da..f674e556f 100644 --- a/Makefile +++ b/Makefile @@ -378,7 +378,6 @@ ifeq ($(uname_O),Cygwin) NO_STRCASESTR = YesPlease NO_SYMLINK_HEAD = YesPlease NEEDS_LIBICONV = YesPlease - NO_C99_FORMAT = YesPlease NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes NO_TRUSTABLE_FILEMODE = UnfortunatelyYes # There are conflicting reports about this. -- cgit v1.2.1