Merge branch 'maint'
* maint: Unset NO_C99_FORMAT on Cygwin. Fix a "pointer type missmatch" warning. Fix some "comparison is always true/false" warnings. Fix an "implicit function definition" warning. Fix a "label defined but unreferenced" warning. Document the config variable format.suffix git-merge: fail correctly when we cannot fast forward. builtin-archive: use RUN_SETUP Fix git-gc usage note
This commit is contained in:
commit
253e772ede
@ -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
|
||||
|
8
Makefile
8
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
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Cleanup unreachable files and optimize the repository.
|
||||
|
||||
USAGE='git-gc [--prune]'
|
||||
USAGE='[--prune]'
|
||||
SUBDIRECTORY_OK=Yes
|
||||
. git-sh-setup
|
||||
|
||||
|
@ -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
|
||||
;;
|
||||
|
2
git.c
2
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 },
|
||||
|
2
refs.c
2
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);
|
||||
|
||||
|
20
utf8.c
20
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);
|
||||
|
Loading…
Reference in New Issue
Block a user