summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/config.txt5
-rw-r--r--Makefile8
-rw-r--r--builtin-archive.c2
-rw-r--r--git-compat-util.h6
-rwxr-xr-xgit-gc.sh2
-rwxr-xr-xgit-merge.sh2
-rw-r--r--git.c2
-rw-r--r--refs.c2
-rw-r--r--utf8.c20
9 files changed, 37 insertions, 12 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index d2b4a05..d20902b 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -341,6 +341,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
diff --git a/Makefile b/Makefile
index 9a37b15..a221bdc 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.
@@ -378,7 +381,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.
@@ -576,6 +578,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/builtin-archive.c b/builtin-archive.c
index 8ea6cb1..2fae885 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-compat-util.h b/git-compat-util.h
index 5d154fa..56212b2 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -49,9 +49,15 @@
#include <netdb.h>
#include <pwd.h>
#include <inttypes.h>
+#if defined(__CYGWIN__)
+#undef _XOPEN_SOURCE
+#include <grp.h>
+#define _XOPEN_SOURCE 600
+#else
#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
#include <grp.h>
#define _ALL_SOURCE 1
+#endif
#ifndef NO_ICONV
#include <iconv.h>
diff --git a/git-gc.sh b/git-gc.sh
index 1a45de5..436d7ca 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
diff --git a/git-merge.sh b/git-merge.sh
index 498c938..4afcd95 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
;;
diff --git a/git.c b/git.c
index 9b37f42..04fc99a 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 },
{ "bundle", cmd_bundle },
diff --git a/refs.c b/refs.c
index d347876..7a1f89c 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);
diff --git a/utf8.c b/utf8.c
index 9e1a6d4..a2965c9 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 */
@@ -298,11 +300,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;
@@ -314,7 +322,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);