From patchwork Mon Jul 1 14:45:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barret Rhoden X-Patchwork-Id: 11026173 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 7A1E213BD for ; Mon, 1 Jul 2019 14:46:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A79326E98 for ; Mon, 1 Jul 2019 14:46:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E70D27D16; Mon, 1 Jul 2019 14:46:28 +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 0557826E98 for ; Mon, 1 Jul 2019 14:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729810AbfGAOq1 (ORCPT ); Mon, 1 Jul 2019 10:46:27 -0400 Received: from mail-pl1-f201.google.com ([209.85.214.201]:35225 "EHLO mail-pl1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727714AbfGAOq0 (ORCPT ); Mon, 1 Jul 2019 10:46:26 -0400 Received: by mail-pl1-f201.google.com with SMTP id bb9so7410046plb.2 for ; Mon, 01 Jul 2019 07:46:26 -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=pgJ0Fi5uVpMgC5YrFEcVXOFLEH24OXtdowOkCYH23V1R4o3m3aKxhcfpJEYmVUtFLe rFxHDKTRKNIJv6GE7AZEAViNazRTGcPL7vwK/2ZE5SLi/Th75DpWg9rALCByWLIc1BSy tTfoYHPzHGVihLRat5TKXRIkWNWWyD8KBZaAcN+9WBDRnoRQpPRgoX4adE6Iz4kvARni j49zQVUVgQhv8sG2WR5xElJRynuSHF9lySRZJyBww0JzHwmnNk69p6KJ59n292IXyR0A ZQO1fumRCCX96Y8Xs5eJgtk0VDXE//l/AQy6c3u/jIsb4O8G2e6Je5qzanbhE04q4StK 0qbA== 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=Lv4udX5V7WOuvxrWrXwqfXtwX+i9yUoUyyq1jm/V4Wh7DiOvg020d7bVy7AbM5xdb6 GkkWB4XuQWU2nK+ZSSWlRvs96FPc1g3qcYXuwyj/71O4dIkjW1H8gG1GVYYTpDExvtSc oo4+ilj5BUWK8swk+aIJb+fymgV1NdcQa/JNj34gTWStc79tuJPm1WKpnMtQSowNrZNa Gk4gyN8cIzcaobbqqwbT03HSaBwz60RMGGErI9vrRus69XXtx9kNIgU46Psw1tyD0P6k tnRMJ4nLF+LGvFx6W8c2+etiNsXRUEJwHNtysvKIBP5s1EYdO3Cj74WlqNXeHryt+/qM zr1A== X-Gm-Message-State: APjAAAUUvELm8QpOYBWYvR2+QTBPS572gcAscpWN2qb4B8fRD3wK1YYW 5Cjt2zgAESonWD3AYHCkwe4s5vTsKh+16J+ujvsNCAX7XX12fEbUpo/LqLUOU3n2Q7Ns2bLWeUb wHSJ6P4QJpP5BMcPtWi3hZ1g6qWFVeVWHOKhwJPHhdzOnxwVgaV4X X-Google-Smtp-Source: APXvYqyknvXQcaBaNyDJW4d2m8JXyRNoqBoKH8+8vlqFAHX8LjHyhYzD9gV5TVujuIc6cQtsFdlJdLIX X-Received: by 2002:a63:2a0f:: with SMTP id q15mr25804948pgq.163.1561992385511; Mon, 01 Jul 2019 07:46:25 -0700 (PDT) Date: Mon, 1 Jul 2019 10:45:48 -0400 In-Reply-To: <20190701144548.129635-1-brho@google.com> Message-Id: <20190701144548.129635-10-brho@google.com> Mime-Version: 1.0 References: <20190701144548.129635-1-brho@google.com> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog Subject: [PATCH v10 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