From patchwork Mon Nov 11 06:03:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBEYW5o?= X-Patchwork-Id: 11236591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D27B81864 for ; Mon, 11 Nov 2019 06:04:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF72920679 for ; Mon, 11 Nov 2019 06:04:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FEfKmsQZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726916AbfKKGER (ORCPT ); Mon, 11 Nov 2019 01:04:17 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44938 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbfKKGER (ORCPT ); Mon, 11 Nov 2019 01:04:17 -0500 Received: by mail-pf1-f196.google.com with SMTP id q26so9909577pfn.11 for ; Sun, 10 Nov 2019 22:04:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yvhckOTi7yJkJ+fP0MtCiRWhSTZCUXYpJVLSditKkC0=; b=FEfKmsQZyaEM2Nts43LQ6tbQHa1c/YiThfG3XQnH+sRy2QkkWjircOguzn9SW6+hhH EyBbuJcTPfXaFEJo/Rgwyy3dhVJAQp0KecgKoXZiwL2wYRpThDKfrOH7TeAwkYljZw42 poLD86po29bjuZsONrvip1ym+C+Q1PxuS4ExulcYX84RoaSNVNKxt8gswSnNG52QxoZV meCZ7NyeoNzh8zn/tCzNOL4KX2V9qdXyUMxG6sAlB+TFYfXgrm/p6xHovHoiD8XdKL8L pQxNCXs8g/b/U/kauKwS3MzAJLPfxDwktII5ft/P5AVeQkjuFnrGlQ87iqbAgL+h79z/ 9SkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yvhckOTi7yJkJ+fP0MtCiRWhSTZCUXYpJVLSditKkC0=; b=bT0aOWdweQdJa4Y/WH/or/ivRoTN6GqvA1TidI0RZap3YSMSICIJPzS/Jc/5sL+m5i 42Fdu97a8ZR8d/3dD3pgp+Snpe02+hHYEh4XiR//mzMCWCEAFYIfn32JhEqPXjvVpitb csP0t2rX+XtIB6ErX9Ywobk+U8HNO3jF6gAy6SBP+wyEOwNnt79vEWoZGdsiGnajBzyk 34heikLZ4DpIbB4b4qlxWUNBYtl8Mhvk8dWSJxcRWWHxQ/rmPGBxYBhm9dMAZJfd4JBU hg4LiOIyFcH6V6dvXg4yPdLyU1xlU/7SgAphwghWQ5BcMrbDqSq4OERFFJZdYPBxAFXO 5CXg== X-Gm-Message-State: APjAAAVKjPrCdEhtFKujVqD+Yk6NyGMfdJ3kNbdufE5SG0DhSblkydcI RyVbW0IjfSQv+RmDMzmEClhxvHyr X-Google-Smtp-Source: APXvYqwlkuqq4SEwqy6K1dVV+XKovOdyYvlU1GUprXmqzbJVLhk5g4mu/6v+ys/88zqtRw/eZjVeNg== X-Received: by 2002:a62:e308:: with SMTP id g8mr28313927pfh.121.1573452256234; Sun, 10 Nov 2019 22:04:16 -0800 (PST) Received: from localhost.localdomain ([2402:800:6375:16b7:502d:9b82:436:143a]) by smtp.gmail.com with ESMTPSA id v16sm15112315pje.1.2019.11.10.22.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Nov 2019 22:04:15 -0800 (PST) From: Doan Tran Cong Danh To: git@vger.kernel.org Cc: peff@peff.net, gitster@pobox.com, Doan Tran Cong Danh Subject: [PATCH v6 3/9] t3900: demonstrate git-rebase problem with multi encoding Date: Mon, 11 Nov 2019 13:03:36 +0700 Message-Id: X-Mailer: git-send-email 2.24.0.164.g78daf050de.dirty In-Reply-To: References: <20191031092618.29073-1-congdanhqx@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org We're using fixup!/squash! to mark if current commit will be used to be fixed up or squashed to a previous commit. However, if we're changing i18n.commitencoding after making the original commit but before making the fixing up, we couldn't find the original commit to do the fixup/squash. Add a test to demonstrate that problem. Helped-by: Jeff King Signed-off-by: Doan Tran Cong Danh --- t/t3900-i18n-commit.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index b92ff95977..dd56384b93 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -204,4 +204,33 @@ test_commit_autosquash_flags eucJP fixup test_commit_autosquash_flags ISO-2022-JP squash +test_commit_autosquash_multi_encoding () { + flag=$1 + old=$2 + new=$3 + msg=$4 + test_expect_failure "commit --$flag into $old from $new" ' + git checkout -b $flag-$old-$new C0 && + git config i18n.commitencoding $old && + echo $old >>F && + git commit -a -F "$TEST_DIRECTORY"/t3900/$msg && + test_tick && + echo intermediate stuff >>G && + git add G && + git commit -a -m "intermediate commit" && + test_tick && + git config i18n.commitencoding $new && + echo $new-$flag >>F && + git commit -a --$flag HEAD^ && + git rebase --autosquash -i HEAD^^^ && + git rev-list HEAD >actual && + test_line_count = 3 actual + ' +} + +test_commit_autosquash_multi_encoding fixup UTF-8 ISO-8859-1 1-UTF-8.txt +test_commit_autosquash_multi_encoding squash ISO-8859-1 UTF-8 ISO8859-1.txt +test_commit_autosquash_multi_encoding squash eucJP ISO-2022-JP eucJP.txt +test_commit_autosquash_multi_encoding fixup ISO-2022-JP UTF-8 ISO-2022-JP.txt + test_done