From: Eric Wong Date: Sat, 30 May 2009 00:14:47 +0000 (-0700) Subject: t9139 uses ancient, backwards-compatible iconv names X-Git-Tag: v1.6.4-rc0~100^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/188643140bdcc5c8b7029058da87510cf1aeff50?ds=inline;hp=-c t9139 uses ancient, backwards-compatible iconv names This resolves a semantic conflicts early to work with 5ae93df (t3900: use ancient iconv names for backward compatibility, 2009-05-18). Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- 188643140bdcc5c8b7029058da87510cf1aeff50 diff --combined builtin-log.c index f10cfebdbb,58db9592c9..17d06bf202 --- a/builtin-log.c +++ b/builtin-log.c @@@ -619,7 -619,7 +619,7 @@@ static void make_cover_letter(struct re struct shortlog log; struct strbuf sb = STRBUF_INIT; int i; - const char *encoding = "utf-8"; + const char *encoding = "UTF-8"; struct diff_options opts; int need_8bit_cte = 0; struct commit *commit = NULL; @@@ -755,7 -755,6 +755,7 @@@ int cmd_format_patch(int argc, const ch int cover_letter = 0; int boundary_count = 0; int no_binary_diff = 0; + int numbered_cmdline_opt = 0; struct commit *origin = NULL, *head = NULL; const char *in_reply_to = NULL; struct patch_ids ids; @@@ -787,10 -786,8 +787,10 @@@ if (!strcmp(argv[i], "--stdout")) use_stdout = 1; else if (!strcmp(argv[i], "-n") || - !strcmp(argv[i], "--numbered")) + !strcmp(argv[i], "--numbered")) { numbered = 1; + numbered_cmdline_opt = 1; + } else if (!strcmp(argv[i], "-N") || !strcmp(argv[i], "--no-numbered")) { numbered = 0; @@@ -921,15 -918,6 +921,15 @@@ if (start_number < 0) start_number = 1; + + /* + * If numbered is set solely due to format.numbered in config, + * and it would conflict with --keep-subject (-k) from the + * command line, reset "numbered". + */ + if (numbered && keep_subject && !numbered_cmdline_opt) + numbered = 0; + if (numbered && keep_subject) die ("-n and -k are mutually exclusive."); if (keep_subject && subject_prefix) diff --combined t/t9129-git-svn-i18n-commitencoding.sh index d45fb73016,6c6d033807..b9224bdb20 --- a/t/t9129-git-svn-i18n-commitencoding.sh +++ b/t/t9129-git-svn-i18n-commitencoding.sh @@@ -29,16 -29,16 +29,16 @@@ compare_svn_head_with () test_cmp current "$1" } - for H in ISO-8859-1 EUCJP ISO-2022-JP + for H in ISO8859-1 eucJP ISO-2022-JP do test_expect_success "$H setup" ' mkdir $H && - svn import -m "$H test" $H "$svnrepo"/$H && + svn_cmd import -m "$H test" $H "$svnrepo"/$H && git svn clone "$svnrepo"/$H $H ' done - for H in ISO-8859-1 EUCJP ISO-2022-JP + for H in ISO8859-1 eucJP ISO-2022-JP do test_expect_success "$H commit on git side" ' ( @@@ -55,7 -55,7 +55,7 @@@ ' done - for H in ISO-8859-1 EUCJP ISO-2022-JP + for H in ISO8859-1 eucJP ISO-2022-JP do test_expect_success "$H dcommit to svn" ' ( @@@ -77,12 -77,12 +77,12 @@@ f test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' ' ( - cd ISO-8859-1 && + cd ISO8859-1 && compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt ) ' - for H in EUCJP ISO-2022-JP + for H in eucJP ISO-2022-JP do test_expect_success UTF8 "$H should match UTF-8 in svn" ' ( diff --combined t/t9139-git-svn-non-utf8-commitencoding.sh index 2b1db97337,0000000000..f337959ccc mode 100755,000000..100755 --- a/t/t9139-git-svn-non-utf8-commitencoding.sh +++ b/t/t9139-git-svn-non-utf8-commitencoding.sh @@@ -1,47 -1,0 +1,47 @@@ +#!/bin/sh +# +# Copyright (c) 2009 Eric Wong + +test_description='git svn refuses to dcommit non-UTF8 messages' + +. ./lib-git-svn.sh + +# ISO-2022-JP can pass for valid UTF-8, so skipping that in this test + - for H in ISO-8859-1 EUCJP ++for H in ISO8859-1 eucJP +do + test_expect_success "$H setup" ' + mkdir $H && + svn_cmd import -m "$H test" $H "$svnrepo"/$H && + git svn clone "$svnrepo"/$H $H + ' +done + - for H in ISO-8859-1 EUCJP ++for H in ISO8859-1 eucJP +do + test_expect_success "$H commit on git side" ' + ( + cd $H && + git config i18n.commitencoding $H && + git checkout -b t refs/remotes/git-svn && + echo $H >F && + git add F && + git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt && + E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") && + test "z$E" = "z$H" + ) + ' +done + - for H in ISO-8859-1 EUCJP ++for H in ISO8859-1 eucJP +do + test_expect_success "$H dcommit to svn" ' + ( + cd $H && + git config --unset i18n.commitencoding && + ! git svn dcommit + ) + ' +done + +test_done