Skip to content

Commit 253e772

Browse files
author
Junio C Hamano
committed
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
2 parents 4808bec + 7943b3a commit 253e772

File tree

9 files changed

+37
-12
lines changed

9 files changed

+37
-12
lines changed

Documentation/config.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ format.headers::
341341
Additional email headers to include in a patch to be submitted
342342
by mail. See gitlink:git-format-patch[1].
343343

344+
format.suffix::
345+
The default for format-patch is to output files with the suffix
346+
`.patch`. Use this variable to change that suffix (make sure to
347+
include the dot if you want it).
348+
344349
gc.packrefs::
345350
`git gc` does not run `git pack-refs` in a bare repository by
346351
default so that older dumb-transport clients can still fetch

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ all::
8989
#
9090
# Define NO_ICONV if your libc does not properly support iconv.
9191
#
92+
# Define OLD_ICONV if your library has an old iconv(), where the second
93+
# (input buffer pointer) parameter is declared with type (const char **).
94+
#
9295
# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
9396
# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
9497
# is used instead.
@@ -378,7 +381,6 @@ ifeq ($(uname_O),Cygwin)
378381
NO_STRCASESTR = YesPlease
379382
NO_SYMLINK_HEAD = YesPlease
380383
NEEDS_LIBICONV = YesPlease
381-
NO_C99_FORMAT = YesPlease
382384
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
383385
NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
384386
# There are conflicting reports about this.
@@ -576,6 +578,10 @@ ifdef NO_ICONV
576578
BASIC_CFLAGS += -DNO_ICONV
577579
endif
578580

581+
ifdef OLD_ICONV
582+
BASIC_CFLAGS += -DOLD_ICONV
583+
endif
584+
579585
ifdef PPC_SHA1
580586
SHA1_HEADER = "ppc/sha1.h"
581587
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o

builtin-archive.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
252252

253253
memset(&ar, 0, sizeof(ar));
254254
tree_idx = parse_archive_args(argc, argv, &ar);
255-
if (prefix == NULL)
256-
prefix = setup_git_directory();
257255

258256
argv += tree_idx;
259257
parse_treeish_arg(argv, &ar.args, prefix);

git-compat-util.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@
4949
#include <netdb.h>
5050
#include <pwd.h>
5151
#include <inttypes.h>
52+
#if defined(__CYGWIN__)
53+
#undef _XOPEN_SOURCE
54+
#include <grp.h>
55+
#define _XOPEN_SOURCE 600
56+
#else
5257
#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
5358
#include <grp.h>
5459
#define _ALL_SOURCE 1
60+
#endif
5561

5662
#ifndef NO_ICONV
5763
#include <iconv.h>

git-gc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Cleanup unreachable files and optimize the repository.
66

7-
USAGE='git-gc [--prune]'
7+
USAGE='[--prune]'
88
SUBDIRECTORY_OK=Yes
99
. git-sh-setup
1010

git-merge.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ f,*)
294294
git-update-index --refresh 2>/dev/null
295295
new_head=$(git-rev-parse --verify "$1^0") &&
296296
git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
297-
finish "$new_head" "Fast forward"
297+
finish "$new_head" "Fast forward" || exit
298298
dropsave
299299
exit 0
300300
;;

git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
226226
{ "add", cmd_add, RUN_SETUP | NOT_BARE },
227227
{ "annotate", cmd_annotate, USE_PAGER },
228228
{ "apply", cmd_apply },
229-
{ "archive", cmd_archive },
229+
{ "archive", cmd_archive, RUN_SETUP },
230230
{ "blame", cmd_blame, RUN_SETUP },
231231
{ "branch", cmd_branch, RUN_SETUP },
232232
{ "bundle", cmd_bundle },

refs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,9 @@ int create_symref(const char *ref_target, const char *refs_heads_master,
10421042
return -1;
10431043
}
10441044

1045+
#ifndef NO_SYMLINK_HEAD
10451046
done:
1047+
#endif
10461048
if (logmsg && !read_ref(refs_heads_master, new_sha1))
10471049
log_ref_write(ref_target, old_sha1, new_sha1, logmsg);
10481050

utf8.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
/* This code is originally from http://www.cl.cam.ac.uk/~mgk25/ucs/ */
55

6+
typedef unsigned int ucs_char_t; /* assuming 32bit int */
7+
68
struct interval {
79
int first;
810
int last;
911
};
1012

1113
/* auxiliary function for binary search in interval table */
12-
static int bisearch(wchar_t ucs, const struct interval *table, int max) {
14+
static int bisearch(ucs_char_t ucs, const struct interval *table, int max) {
1315
int min = 0;
1416
int mid;
1517

@@ -56,11 +58,11 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) {
5658
* ISO 8859-1 and WGL4 characters, Unicode control characters,
5759
* etc.) have a column width of 1.
5860
*
59-
* This implementation assumes that wchar_t characters are encoded
61+
* This implementation assumes that ucs_char_t characters are encoded
6062
* in ISO 10646.
6163
*/
6264

63-
static int wcwidth(wchar_t ch)
65+
static int wcwidth(ucs_char_t ch)
6466
{
6567
/*
6668
* Sorted list of non-overlapping intervals of non-spacing characters,
@@ -157,7 +159,7 @@ static int wcwidth(wchar_t ch)
157159
int utf8_width(const char **start)
158160
{
159161
unsigned char *s = (unsigned char *)*start;
160-
wchar_t ch;
162+
ucs_char_t ch;
161163

162164
if (*s < 0x80) {
163165
/* 0xxxxxxx */
@@ -298,11 +300,17 @@ int is_encoding_utf8(const char *name)
298300
* with iconv. If the conversion fails, returns NULL.
299301
*/
300302
#ifndef NO_ICONV
303+
#ifdef OLD_ICONV
304+
typedef const char * iconv_ibp;
305+
#else
306+
typedef char * iconv_ibp;
307+
#endif
301308
char *reencode_string(const char *in, const char *out_encoding, const char *in_encoding)
302309
{
303310
iconv_t conv;
304311
size_t insz, outsz, outalloc;
305-
char *out, *outpos, *cp;
312+
char *out, *outpos;
313+
iconv_ibp cp;
306314

307315
if (!in_encoding)
308316
return NULL;
@@ -314,7 +322,7 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e
314322
outalloc = outsz + 1; /* for terminating NUL */
315323
out = xmalloc(outalloc);
316324
outpos = out;
317-
cp = (char *)in;
325+
cp = (iconv_ibp)in;
318326

319327
while (1) {
320328
size_t cnt = iconv(conv, &cp, &insz, &outpos, &outsz);

0 commit comments

Comments
 (0)