t9139 uses ancient, backwards-compatible iconv names
authorEric Wong <normalperson@yhbt.net>
Sat, 30 May 2009 00:14:47 +0000 (17:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 31 May 2009 05:30:55 +0000 (22:30 -0700)
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 <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1  2 
builtin-log.c
t/t9129-git-svn-i18n-commitencoding.sh
t/t9139-git-svn-non-utf8-commitencoding.sh
diff --combined builtin-log.c
index f10cfebdbbabac67dea41639289e7ad968d5bbe3,58db9592c93070176273ff8c843f382b30174a32..17d06bf20211cc0c881bceb2f24c5c1df516daf8
@@@ -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;
                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;
  
        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)
index d45fb73016362827e647118eec028c8b85e5aeff,6c6d0338075232074888b54eb5ac2da28fe8c5c7..b9224bdb20a397f40f1504684e1144428cf8a24e
@@@ -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" '
                (
index 2b1db9733708e885aa7c12db9fa8b03a6799326a,0000000000000000000000000000000000000000..f337959cccc78c40094ed6d81bdd502860e5e02b
mode 100755,000000..100755
--- /dev/null
@@@ -1,47 -1,0 +1,47 @@@
- for H in ISO-8859-1 EUCJP
 +#!/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 ISO8859-1 eucJP
 +do
 +      test_expect_success "$H dcommit to svn" '
 +      (
 +              cd $H &&
 +              git config --unset i18n.commitencoding &&
 +              ! git svn dcommit
 +      )
 +      '
 +done
 +
 +test_done