From patchwork Thu Jun 20 16:38:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barret Rhoden X-Patchwork-Id: 11007451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E49F5924 for ; Thu, 20 Jun 2019 16:40:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D802881A for ; Thu, 20 Jun 2019 16:40:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC4C528846; Thu, 20 Jun 2019 16:40:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B7652881A for ; Thu, 20 Jun 2019 16:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732375AbfFTQjx (ORCPT ); Thu, 20 Jun 2019 12:39:53 -0400 Received: from mail-pg1-f201.google.com ([209.85.215.201]:53291 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732201AbfFTQi4 (ORCPT ); Thu, 20 Jun 2019 12:38:56 -0400 Received: by mail-pg1-f201.google.com with SMTP id j36so2096337pgb.20 for ; Thu, 20 Jun 2019 09:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=bspsNAjXAX8xQZooyKU2OPmxbmU3vPrBvNkTDWda4Bk=; b=rmpXWiruWC8XLfRoeRhEpnkYEST40axHm45tfpsuoIUySrW4USfeL9Y82EZVDV/kq8 vgZbtPSbUC4L7GP1023l4IVQDdNq1yLDwzDWwcwXBeMNneeRy2QypArHMlhImcO1VCqd vy6Bub9aAG/6C4D/+/HP0cbZS6IHr5uZYvDA3bwtHNOLSD518Mq73scUkEnfAVkNTqtH cCrqI/ILMmuu/Zdkl/hm/ibIevtduTgRRIvk4z4P65jUmk9DDGTbhJ1VbDDCmCQ+1wVS bGHz2dlXBlUfoT5zncPXcdAnuA1KfDziUk3aZLgHhx0tg4E7pmVTgdjBd5cdWljZvCZ+ Q1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=bspsNAjXAX8xQZooyKU2OPmxbmU3vPrBvNkTDWda4Bk=; b=pksS02XWy0bh4bCl7j6SXa2m6nZnQ65JIXxF59LjMiGJZchX5DdknoZuV0yONskXaI ga99zrwZMXuSci2lcfmI/yV3SjlvjsvylW3lDLDQsZ8zgjBcOM/KjfqF5ZUquS8oA+EI fwQ8Uchp7GtHARj78EHTLIgkfn7zF7mw0aDYipYydp5a9754BQ1NYE8rooeQmP7Q/D84 0xRK0AwdPMdW7DU5dRsetOfFDg2ZPhHpP0YFasDxKF7VU6YI8cjwybF4PvYazUvgaa4s vz0zwhNdLNL9hFnEkA0BUVl4o9efhvTI4C7qIOwq+I4BGbN6CNDpiliPZuwvVtoCEnVZ wkWg== X-Gm-Message-State: APjAAAXWRN9zSRuazfF5ceqGwpzogVjgNl5iFYSokKb6H7HOCGwwmWC6 DXk4POcI3ol+xHAz/m020vl/q9vLkpOPX17ry/cvaHDYP9fxZ8VDwM2Y2CU7755fHi2XevrFJGa tz6rpD5ULKlAzsxSzG8pENz0Y5uiVmRNzVhS9RIPkg+TOjQIYhKYd X-Google-Smtp-Source: APXvYqwBSo9EVcoG5YEWoaYHd42bwSIpU/TMfSDmSpNg+X/FMYCvMA6QWvfH6wzydi8cTN3SdULv0iba X-Received: by 2002:a63:1d1d:: with SMTP id d29mr13585339pgd.259.1561048735136; Thu, 20 Jun 2019 09:38:55 -0700 (PDT) Date: Thu, 20 Jun 2019 12:38:20 -0400 In-Reply-To: <20190620163820.231316-1-brho@google.com> Message-Id: <20190620163820.231316-10-brho@google.com> Mime-Version: 1.0 References: <20190620163820.231316-1-brho@google.com> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH v9 9/9] blame: add a test to cover blame_coalesce() From: Barret Rhoden To: git@vger.kernel.org Cc: " =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= " , David Kastrup , Jeff King , Jeff Smith , Johannes Schindelin , Junio C Hamano , " =?utf-8?q?Ren=C3=A9_Scharfe?= " , Stefan Beller , Michael Platings Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Barret Rhoden --- t/t8003-blame-corner-cases.sh | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh index c92a47b6d5b1..1c5fb1d1f8c9 100755 --- a/t/t8003-blame-corner-cases.sh +++ b/t/t8003-blame-corner-cases.sh @@ -275,4 +275,40 @@ test_expect_success 'blame file with CRLF core.autocrlf=true' ' grep "A U Thor" actual ' +# Tests the splitting and merging of blame entries in blame_coalesce(). +# The output of blame is the same, regardless of whether blame_coalesce() runs +# or not, so we'd likely only notice a problem if blame crashes or assigned +# blame to the "splitting" commit ('SPLIT' below). +test_expect_success 'blame coalesce' ' + cat >giraffe <<-\EOF && + ABC + DEF + EOF + git add giraffe && + git commit -m "original file" && + oid=$(git rev-parse HEAD) && + + cat >giraffe <<-\EOF && + ABC + SPLIT + DEF + EOF + git add giraffe && + git commit -m "interior SPLIT line" && + + cat >giraffe <<-\EOF && + ABC + DEF + EOF + git add giraffe && + git commit -m "same contents as original" && + + cat >expect <<-EOF && + $oid 1) ABC + $oid 2) DEF + EOF + git -c core.abbrev=40 blame -s giraffe >actual && + test_cmp expect actual +' + test_done