From: Junio C Hamano Date: Tue, 20 Nov 2012 17:57:44 +0000 (-0800) Subject: Merge branch 'js/format-2047' into maint X-Git-Tag: v1.8.0.1~12 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fd778c09b1bb683d930dae59566bce79be89c628?ds=inline;hp=-c Merge branch 'js/format-2047' into maint Various rfc2047 quoting issues around a non-ASCII name on the From: line in the output from format-patch have been corrected. * js/format-2047: format-patch tests: check quoting/encoding in To: and Cc: headers format-patch: fix rfc2047 address encoding with respect to rfc822 specials format-patch: make rfc2047 encoding more strict format-patch: introduce helper function last_line_length() format-patch: do not wrap rfc2047 encoded headers too late format-patch: do not wrap non-rfc2047 headers too early utf8: fix off-by-one wrapping of text --- fd778c09b1bb683d930dae59566bce79be89c628 diff --combined git-compat-util.h index 2fbf1fd8b1,f011a8d7bb..2e79b8a2f3 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -74,8 -74,7 +74,8 @@@ # define _XOPEN_SOURCE 500 # endif #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \ - !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) + !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \ + !defined(__TANDEM) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif @@@ -99,9 -98,6 +99,9 @@@ #include #include #include +#ifdef __TANDEM /* or HAVE_STRINGS_H or !NO_STRINGS_H? */ +#include /* for strcasecmp() */ +#endif #include #include #include @@@ -145,17 -141,6 +145,17 @@@ #else #include #endif +#ifdef NO_INTPTR_T +/* + * On I16LP32, ILP32 and LP64 "long" is the save bet, however + * on LLP86, IL33LLP64 and P64 it needs to be "long long", + * while on IP16 and IP16L32 it is "int" (resp. "short") + * Size needs to match (or exceed) 'sizeof(void *)'. + * We can't take "long long" here as not everybody has it. + */ +typedef long intptr_t; +typedef unsigned long uintptr_t; +#endif #if defined(__CYGWIN__) #undef _XOPEN_SOURCE #include @@@ -168,31 -153,6 +168,31 @@@ #endif #endif +/* used on Mac OS X */ +#ifdef PRECOMPOSE_UNICODE +#include "compat/precompose_utf8.h" +#else +#define precompose_str(in,i_nfd2nfc) +#define precompose_argv(c,v) +#define probe_utf8_pathname_composition(a,b) +#endif + +#ifdef MKDIR_WO_TRAILING_SLASH +#define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b)) +extern int compat_mkdir_wo_trailing_slash(const char*, mode_t); +#endif + +#ifdef NO_STRUCT_ITIMERVAL +struct itimerval { + struct timeval it_interval; + struct timeval it_value; +} +#endif + +#ifdef NO_SETITIMER +#define setitimer(which,value,ovalue) +#endif + #ifndef NO_LIBGEN_H #include #else @@@ -506,6 -466,7 +506,7 @@@ extern const char tolower_trans_tbl[256 #undef isdigit #undef isalpha #undef isalnum + #undef isprint #undef islower #undef isupper #undef tolower @@@ -523,6 -484,7 +524,7 @@@ extern unsigned char sane_ctype[256] #define isdigit(x) sane_istest(x,GIT_DIGIT) #define isalpha(x) sane_istest(x,GIT_ALPHA) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) + #define isprint(x) ((x) >= 0x20 && (x) <= 0x7e) #define islower(x) sane_iscase(x, 1) #define isupper(x) sane_iscase(x, 0) #define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL) @@@ -635,12 -597,6 +637,12 @@@ int rmdir_or_warn(const char *path) */ int remove_or_warn(unsigned int mode, const char *path); +/* Call access(2), but warn for any error besides ENOENT. */ +int access_or_warn(const char *path, int mode); + +/* Warn on an inaccessible file that ought to be accessible */ +void warn_on_inaccessible(const char *path); + /* Get the passwd entry for the UID of the current process. */ struct passwd *xgetpwuid_self(void); diff --combined t/t4202-log.sh index e6537abe1d,37023e30ea..a343bf6c62 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@@ -72,9 -72,9 +72,9 @@@ cat > expect << EO commit. EOF - test_expect_success 'format %w(12,1,2)' ' + test_expect_success 'format %w(11,1,2)' ' - git log -2 --format="%w(12,1,2)This is the %s commit." > actual && + git log -2 --format="%w(11,1,2)This is the %s commit." > actual && test_cmp expect actual ' @@@ -178,21 -178,11 +178,21 @@@ test_expect_success 'git log --no-walk test_cmp expect actual ' +test_expect_success 'git log --no-walk=sorted sorts by commit time' ' + git log --no-walk=sorted --oneline 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + cat > expect << EOF 5d31159 fourth 804a787 sixth 394ef78 fifth EOF +test_expect_success 'git log --no-walk=unsorted leaves list of commits as given' ' + git log --no-walk=unsorted --oneline 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + test_expect_success 'git show leaves list of commits as given' ' git show --oneline -s 5d31159 804a787 394ef78 > actual && test_cmp expect actual @@@ -230,12 -220,6 +230,12 @@@ test_expect_success 'log --grep -i' test_cmp expect actual ' +test_expect_success 'log -F -E --grep= uses ere' ' + echo second >expect && + git log -1 --pretty="tformat:%s" -F -E --grep=s.c.nd >actual && + test_cmp expect actual +' + cat > expect <actual && sanitize_output >actual.sanitized