From patchwork Sun Feb 16 13:47:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Kumar X-Patchwork-Id: 11384439 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 E2A6A92A for ; Sun, 16 Feb 2020 13:48:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2FCA206E2 for ; Sun, 16 Feb 2020 13:48:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DWoLNItA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbgBPNsq (ORCPT ); Sun, 16 Feb 2020 08:48:46 -0500 Received: from mail-pg1-f182.google.com ([209.85.215.182]:37495 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgBPNsp (ORCPT ); Sun, 16 Feb 2020 08:48:45 -0500 Received: by mail-pg1-f182.google.com with SMTP id z12so7654094pgl.4 for ; Sun, 16 Feb 2020 05:48:44 -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:mime-version :content-transfer-encoding; bh=kgmcPIYOLU7HcOM1eLDSxVJiwU8V4U8bCUaWbdYepWI=; b=DWoLNItA+44DJt/ZQFVilISoPfoPHHcdl/8dRr6rITp/4XtfuzRS7YX7k8Jl8Mo7I5 DtWri7wtWtjViF+YEL7S9SbHSFl4Uk2zuSS//I0yh/b5B+y9alBrmfif5edEIZX6GGTZ ZhE4ghx/UOQS+duLjQbZ9tDliHiN67WZaBIRSPSeNOi7DzFzyHcS0UB6GG1CGIAZCqX9 JCdsr8jBCczPsstkAPY3pn2XaS/5ebE+bDNllLbJEeWt1ij7QsLmBDLA4rPBO5cRUOZ0 gxVk12O4e0m2697W6zkIBn1n7sz2ZU0cEcfwjf2qfkZoYCKjfrOb1DiFXcFHquZH5hxC bnNQ== 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:mime-version :content-transfer-encoding; bh=kgmcPIYOLU7HcOM1eLDSxVJiwU8V4U8bCUaWbdYepWI=; b=hdrJV3ZiqFMJl0J6Pn8axuc07agTS5oBmey4YbLPhV+xk3atMl6ieADFa4m/tLljyy mAlRo54auPul9mx/uOrzcr0VybTxJ5T/OsLRErHkoIHEfJuJzxcixU9sokpGsxaFrn9q lwpRi/lCAitqoye3E7aSr0Gc1e/FNyBi7MCT3zSAnUUc63Nfq6WX5vsMBz5pyxr/Er5K +9yWCroyCa6LPwjk5T9RBYCr9XrCjChR8WcdwTkPkrAq/OBcSSQ8PYmFwP1UlbrNEU9O FVugaIzUNKEjunRetjrOSdz9B8fRfNbhlP8ahCUaiKZGspKlPjf5t3jObzHBSSKRWux1 iOCQ== X-Gm-Message-State: APjAAAWoPSE/uteoDsl5LWGXx7XUKN4O5kt7I9zGUC8QXRHON5+VDBiQ 3JeNj75koYylLGHSBvXj5V20/FofyM0= X-Google-Smtp-Source: APXvYqzqS7MBzQ7oHg/2zEqPSO8NjGoyyRW7zXayj6+q8aq2L/rhH5Kt1d4M3efEVZYbTlFA2I/rXg== X-Received: by 2002:a63:34b:: with SMTP id 72mr12588243pgd.278.1581860923217; Sun, 16 Feb 2020 05:48:43 -0800 (PST) Received: from Abhishek-Arch.nitk.ac.in ([218.248.46.83]) by smtp.gmail.com with ESMTPSA id m12sm13302006pjf.25.2020.02.16.05.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 05:48:42 -0800 (PST) From: Abhishek Kumar To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [GSoC Patch 1/5] lib-log-graph.sh: consolidate test_cmp_graph logic Date: Sun, 16 Feb 2020 19:17:46 +0530 Message-Id: <20200216134750.18947-1-abhishekkumar8222@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Logic for comparing log graphs is duplicated across test scripts. This patchset consolidates such logic into lib-log-graph. Helped-by: Johannes Schindelin Signed-off-by: Abhishek Kumar --- 1. I don't think this patchset requires a cover letter or extended commit descriptions - Fairly simple, straightforward changes. 2. This patchset closes issue #471 from gitgitgadget. t/lib-log-graph.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 t/lib-log-graph.sh diff --git a/t/lib-log-graph.sh b/t/lib-log-graph.sh new file mode 100644 index 0000000000..999f2600de --- /dev/null +++ b/t/lib-log-graph.sh @@ -0,0 +1,39 @@ +# Helpers shared by the test scripts for comparing log graphs. + +sanitize_output() { + sed -e 's/ *$//' \ + -e 's/commit [0-9a-f]*$/commit COMMIT_OBJECT_NAME/' \ + -e 's/Merge: [ 0-9a-f]*$/Merge: MERGE_PARENTS/' \ + -e 's/Merge tag.*/Merge HEADS DESCRIPTION/' \ + -e 's/Merge commit.*/Merge HEADS DESCRIPTION/' \ + -e 's/, 0 deletions(-)//' \ + -e 's/, 0 insertions(+)//' \ + -e 's/ 1 files changed, / 1 file changed, /' \ + -e 's/, 1 deletions(-)/, 1 deletion(-)/' \ + -e 's/, 1 insertions(+)/, 1 insertion(+)/' \ + -e 's/index [0-9a-f]*\.\.[0-9a-f]*/index BEFORE..AFTER/' +} + +# Assume expected graph is in file `expect` +test_cmp_graph_file() { + git log --graph "$@" >output && + sanitize_output >output.trimmed expect && + test_cmp_graph_file "$@" +} + +# Assume expected graph is in file `expect.colors` +test_cmp_colored_graph_file() { + git log --graph --color=always "$@" >output.colors.raw && + test_decode_color output.colors && + test_cmp expect.colors output.colors +} + +test_cmp_colored_graph() { + cat >expect.colors && + test_cmp_colored_graph_file "$@" +} From patchwork Sun Feb 16 13:47:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Abhishek Kumar X-Patchwork-Id: 11384441 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 1499E1820 for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA282206E2 for ; Sun, 16 Feb 2020 13:48:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sQx+FEmO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727891AbgBPNsq (ORCPT ); Sun, 16 Feb 2020 08:48:46 -0500 Received: from mail-pj1-f51.google.com ([209.85.216.51]:38654 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgBPNsq (ORCPT ); Sun, 16 Feb 2020 08:48:46 -0500 Received: by mail-pj1-f51.google.com with SMTP id j17so6036351pjz.3 for ; Sun, 16 Feb 2020 05:48:45 -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=KTV9rbANTvRkzMiJeqVMO2m/e1XB+3dM7BN7HEUv9TE=; b=sQx+FEmOTdgEvDzEWqjp2u/ultd3FC+noMdZGIdxIidbN38Y0j6iffllmQOnGMUkjc 6ubb5p1ZpcWB7L+ByMQA51Nh0JClwUtY+9gCNObpoQc8AVdo1Ks6o3vbB9NpUq++jero LXmPh9dvnA+kBWITfYDwDIsHkBZ57CpuzIOy5CaHchRFckj9mETxTJl3Kyebs9qISCAX J5/lGdJhXBBtYPIDTYYK8+F7Fvuz9bb+eplfJVXpCk+3hHuXfLA39DrPF/isUuul/nA8 mPI38bvN0YOAc1erC0P9d63G2sFMpdzTnPUJ6un2nSvmq61gEi7lqehlBAX2dwjJPEFX LHdQ== 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=KTV9rbANTvRkzMiJeqVMO2m/e1XB+3dM7BN7HEUv9TE=; b=et5ya6cAr5mrRW8LEyPOwskLqPYvFdeC0R/qNg3Rhw1YlX4P2I0EvK5yEPmx1/plWo ZNsw+blgMvW23hWOj95eyyigw6u71TCi1uIJE37lYeB3x890NgZL9cJ040Yqabd6T8zc EYgG26xvuEXkZhHaG2Bwa0fip/TPbFnNq2Tk38DdOVniOOiG4dYkBX8bylmf1Sq9Dlio /eGAVr/xSgwn5dcXt9pOpJjg09M1r23FfGATUIeGL9hjKhxT2a9ALIFw4IOzhrjM/PCj 7B4AxLzKLlV47L9k2S7EIZMaWc29e4XuGq0WyIuIOekzV9xBAzUcG2znVlof2VWNxfx/ N7FA== X-Gm-Message-State: APjAAAVUKAsvfa4nT89xnuYZ6ADBoE2Z2DQotVRk48zv6BsCXXfwfFkN +MkgNY+M6pQimqUqAqRFsuU+HIcEOeQ= X-Google-Smtp-Source: APXvYqzLhqjZYd/YKPpA6u6bhBzhGJDo3ju02j9+qXNvZ7KlzgnYEayPlFzo52TEWLEj1Lj5tuYqEw== X-Received: by 2002:a17:90b:3cc:: with SMTP id go12mr14477644pjb.89.1581860924875; Sun, 16 Feb 2020 05:48:44 -0800 (PST) Received: from Abhishek-Arch.nitk.ac.in ([218.248.46.83]) by smtp.gmail.com with ESMTPSA id m12sm13302006pjf.25.2020.02.16.05.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 05:48:44 -0800 (PST) From: Abhishek Kumar To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [GSoC Patch 2/5] t3430: use lib-log-graph functions Date: Sun, 16 Feb 2020 19:17:47 +0530 Message-Id: <20200216134750.18947-2-abhishekkumar8222@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200216134750.18947-1-abhishekkumar8222@gmail.com> References: <20200216134750.18947-1-abhishekkumar8222@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Helped-by: Johannes Schindelin Signed-off-by: Abhishek Kumar --- t/t3430-rebase-merges.sh | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index e72ca348ea..74c61fa787 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -20,13 +20,7 @@ Initial setup: ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-rebase.sh - -test_cmp_graph () { - cat >expect && - git log --graph --boundary --format=%s "$@" >output && - sed "s/ *$//" output.trimmed && - test_cmp expect output.trimmed -} +. "$TEST_DIRECTORY"/lib-log-graph.sh test_expect_success 'setup' ' write_script replace-editor.sh <<-\EOF && @@ -84,7 +78,7 @@ test_expect_success 'create completely different structure' ' test_config sequence.editor \""$PWD"/replace-editor.sh\" && test_tick && git rebase -i -r A master && - test_cmp_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF * Merge the topic branch '\''onebranch'\'' |\ | * D @@ -201,7 +195,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' ' git checkout already-upstream && test_tick && git rebase -i -r upstream-with-a2 && - test_cmp_graph upstream-with-a2.. <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary upstream-with-a2.. <<-\EOF * Merge branch A |\ | * A1 @@ -219,7 +213,7 @@ test_expect_success 'do not rebase cousins unless asked for' ' test_cmp_rev HEAD $before && test_tick && git rebase --rebase-merges=rebase-cousins HEAD^ && - test_cmp_graph HEAD^.. <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF * Merge the topic branch '\''onebranch'\'' |\ | * D @@ -311,7 +305,7 @@ test_expect_success 'root commits' ' test $(git rev-parse second-root^0) != $(git rev-parse HEAD^) && test $(git rev-parse second-root:second-root.t) = \ $(git rev-parse HEAD^:second-root.t) && - test_cmp_graph HEAD <<-\EOF && + test_cmp_graph --pretty=tformat:%s --boundary HEAD <<-\EOF && * Merge the 3rd root |\ | * third-root @@ -347,7 +341,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' ' test_tick && git rebase -f -r HEAD^ && test_cmp_rev ! HEAD^2 khnum && - test_cmp_graph HEAD^.. <<-\EOF && + test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF && * Merge branch '\''khnum'\'' into asherah |\ | * yama @@ -355,7 +349,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' ' EOF test_tick && git rebase --rebase-merges=rebase-cousins HEAD^ && - test_cmp_graph HEAD^.. <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary HEAD^.. <<-\EOF * Merge branch '\''khnum'\'' into asherah |\ | * yama @@ -402,7 +396,7 @@ test_expect_success 'octopus merges' ' git rebase -i --force-rebase -r HEAD^^ && test "Hank" = "$(git show -s --format=%an HEAD)" && test "$before" != $(git rev-parse HEAD) && - test_cmp_graph HEAD^^.. <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary HEAD^^.. <<-\EOF *-. Tüntenfüsch |\ \ | | * three @@ -478,7 +472,7 @@ test_expect_success '--rebase-merges with message matched with onto label' ' git checkout -b onto-label E && git merge -m onto G && git rebase --rebase-merges --force-rebase E && - test_cmp_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s --boundary <<-\EOF * onto |\ | * G From patchwork Sun Feb 16 13:47:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Kumar X-Patchwork-Id: 11384443 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 3BF591871 for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D165206E2 for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Is01VMUT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbgBPNst (ORCPT ); Sun, 16 Feb 2020 08:48:49 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:37177 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgBPNsr (ORCPT ); Sun, 16 Feb 2020 08:48:47 -0500 Received: by mail-pj1-f45.google.com with SMTP id m13so6045347pjb.2 for ; Sun, 16 Feb 2020 05:48:47 -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=phce1YG89K2DiWi9AV0W3fuWNMTbfQqY3TC8VVb4d4A=; b=Is01VMUTx72W6pcsxUFNBnkDYsPzOmcpCUO5vrMNgaticJEKlI8IUfRnPXGlCyqWDg mTkFRNpbxeeipPwI9cTUyL10bi54F1/fMgq+E/yits0byVlHJ1i/3D4ombbJAxpwfXBZ dDExOicN88/aLI4ehWtn8e/TbzmGr8YM40gum0evC/z2qHd9zZbz5ghaoP4dP0fDArIN ++CBgPgAqxID+kTcgdYNnMGQE4UOJOziWg48MWV0KSPaZpipLNpkDx33FAYH/jGSLhR8 tCAr4twbTvssmtyphwhzd30Dznvk2sZ5n4RxiBemn6vk/Qd4ohCPH9JE/fyGQJBRK/3M V7cw== 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=phce1YG89K2DiWi9AV0W3fuWNMTbfQqY3TC8VVb4d4A=; b=sXSpW/IMNMOLSBDq15XuO2UMeQNzxDiBOUYh3JeRGsl9Opdgpg5RRbkz3xZUVpLC56 Au44e0NJusjYqMmEzr4kDR1vedtol+UUrQClVFau/Qc1AJF/9FOl5OKXoFDX/Hx/gRtg G8bKC4Ch0CAPDt4LqYA/LwV95X3wSPsh76acWjIw3CY/aGmmLn9bqpCZ2NzTNqegh2qM hh/N+fr1Qc3sLF8Kc/JRXaE+14g65Qub5FnqzQTN0JouDcw1vk5d2Rbs7HD0ZyaBtr1j qeqtckygn3nRgtnC+8oV5puHvqLtqy6130hg2MMCABfIgr3bEE13ROem6RNrs7xTPeP0 6vRw== X-Gm-Message-State: APjAAAVyoROM/vUTLeq6Lo1BZKSgUhUaZnOGPRz1h7LuAgkZiIzv4EV6 owsRGLuztjPFKblToCK4fJb2xh4lpBE= X-Google-Smtp-Source: APXvYqwMOdgkJQlCuXjoz3mmX54+P1JHPeoE9QVLn+r208vhHSsfUeL4K+QbLLrO2zoHP6GaLHh97g== X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr14744800pjv.142.1581860926745; Sun, 16 Feb 2020 05:48:46 -0800 (PST) Received: from Abhishek-Arch.nitk.ac.in ([218.248.46.83]) by smtp.gmail.com with ESMTPSA id m12sm13302006pjf.25.2020.02.16.05.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 05:48:46 -0800 (PST) From: Abhishek Kumar To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [GSoC Patch 3/5] t4215: use lib-log-graph functions Date: Sun, 16 Feb 2020 19:17:48 +0530 Message-Id: <20200216134750.18947-3-abhishekkumar8222@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200216134750.18947-1-abhishekkumar8222@gmail.com> References: <20200216134750.18947-1-abhishekkumar8222@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Helped-by: Johannes Schindelin Signed-off-by: Abhishek Kumar --- t/t4215-log-skewed-merges.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/t/t4215-log-skewed-merges.sh b/t/t4215-log-skewed-merges.sh index 1d0d3240ff..bca478cb83 100755 --- a/t/t4215-log-skewed-merges.sh +++ b/t/t4215-log-skewed-merges.sh @@ -3,13 +3,7 @@ test_description='git log --graph of skewed merges' . ./test-lib.sh - -check_graph () { - cat >expect && - git log --graph --pretty=tformat:%s "$@" >actual.raw && - sed "s/ *$//" actual.raw >actual && - test_cmp expect actual -} +. "$TEST_DIRECTORY"/lib-log-graph.sh test_expect_success 'log --graph with merge fusing with its left and right neighbors' ' git checkout --orphan _p && @@ -22,7 +16,7 @@ test_expect_success 'log --graph with merge fusing with its left and right neigh git checkout _p && git merge --no-ff _r -m G && git checkout @^^ && git merge --no-ff _p -m H && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF * H |\ | * G @@ -50,7 +44,7 @@ test_expect_success 'log --graph with left-skewed merge' ' git checkout 0_p && git merge --no-ff 0_s -m 0_G && git checkout @^ && git merge --no-ff 0_q 0_r 0_t 0_p -m 0_H && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF *-----. 0_H |\ \ \ \ | | | | * 0_G @@ -84,7 +78,7 @@ test_expect_success 'log --graph with nested left-skewed merge' ' git checkout 1_p && git merge --no-ff 1_r -m 1_G && git checkout @^^ && git merge --no-ff 1_p -m 1_H && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF * 1_H |\ | * 1_G @@ -116,7 +110,7 @@ test_expect_success 'log --graph with nested left-skewed merge following normal git checkout -b 2_s @^^ && git merge --no-ff 2_q -m 2_J && git checkout 2_p && git merge --no-ff 2_s -m 2_K && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF * 2_K |\ | * 2_J @@ -152,7 +146,7 @@ test_expect_success 'log --graph with nested right-skewed merge following left-s git checkout 3_p && git merge --no-ff 3_r -m 3_H && git checkout @^^ && git merge --no-ff 3_p -m 3_J && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF * 3_J |\ | * 3_H @@ -183,7 +177,7 @@ test_expect_success 'log --graph with right-skewed merge following a left-skewed git merge --no-ff 4_p -m 4_G && git checkout @^^ && git merge --no-ff 4_s -m 4_H && - check_graph --date-order <<-\EOF + test_cmp_graph --pretty=tformat:%s --date-order <<-\EOF * 4_H |\ | * 4_G @@ -219,7 +213,7 @@ test_expect_success 'log --graph with octopus merge with column joining its penu git checkout 5_r && git merge --no-ff 5_s -m 5_H && - check_graph <<-\EOF + test_cmp_graph --pretty=tformat:%s <<-\EOF * 5_H |\ | *-. 5_G @@ -258,7 +252,7 @@ test_expect_success 'log --graph with multiple tips' ' git checkout 6_1 && git merge --no-ff 6_2 -m 6_I && - check_graph 6_1 6_3 6_5 <<-\EOF + test_cmp_graph --pretty=tformat:%s 6_1 6_3 6_5 <<-\EOF * 6_I |\ | | * 6_H @@ -337,7 +331,7 @@ test_expect_success 'log --graph with multiple tips' ' git checkout -b M_7 7_1 && git merge --no-ff 7_2 7_3 -m 7_M4 && - check_graph M_1 M_3 M_5 M_7 <<-\EOF + test_cmp_graph --pretty=tformat:%s M_1 M_3 M_5 M_7 <<-\EOF * 7_M1 |\ | | * 7_M2 From patchwork Sun Feb 16 13:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Kumar X-Patchwork-Id: 11384445 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 631D3138D for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44347206E2 for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fqOFKjjL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgBPNsu (ORCPT ); Sun, 16 Feb 2020 08:48:50 -0500 Received: from mail-pl1-f179.google.com ([209.85.214.179]:33308 "EHLO mail-pl1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727933AbgBPNsu (ORCPT ); Sun, 16 Feb 2020 08:48:50 -0500 Received: by mail-pl1-f179.google.com with SMTP id ay11so5668098plb.0 for ; Sun, 16 Feb 2020 05:48:49 -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=Ch8DAzCAJNn7naIx5r87yR81G/cwFQYt++WyCnvrzS0=; b=fqOFKjjLJoDkvYQfYPD8TiX+gbaHe3xJToMGCXyD98byyHzoq1tYxERS9fNo8gni9P xOFRXK6goVWP9q+pKIjuhzV/KfRzt9Mwa5dQySx36r688TSuXvj/COWlr+Lrp+k1P2rO 5M/vs+xu5zjii9Nsstzv36zVn/FmKcoHykpQRT8AssUh7LzN9/kWrfqROhGjEn4V4zxK FBkizSXDZ3MRSEDzVHsmwMCu7svdJB1vZYJYIvRnbbIDVQoqG00E+RUFNFQH5Rc3baR8 XvCs1ofqPBvByBucgCxEtaAE0Meqm84ikXq9wp7TyEyB9KLOBxBtyBsfwKYJ3Vky35lw BreA== 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=Ch8DAzCAJNn7naIx5r87yR81G/cwFQYt++WyCnvrzS0=; b=Dn2siOhrNZWUDJQ/4EsynwPwrMn1p95s3kxxvH3h8SqTPgqqw1nHF2Vcof/lJvOfaZ MorcEFYnEZo0Qqbku8/ko59rD8yFf3gbZLopegBzx1IBNQCvAxnKYdNyKp4fgnA3gGja Z0Gzarayi7FB9g0YC4unl6q9f1i3RJoR4MVkaa5wJtTykfrtvGINtIfAf5uDIEKwWQe1 QDtFwkw8HehZURPjDnXbpOYvCaDkZJ4X1ZLCD27fbIcmnJQGtq0UzX5IgXkRlSkkJTcZ TpZgGri2KZgDPJ2lHwLv2locDxj7nGgFwTgVmPv0fghnmQH3fri5ZUHd9b23dvC7ZinI DMhQ== X-Gm-Message-State: APjAAAVlUavaiAYTkP4S91lC7nf4ZZhlEcQZEuP7hmaCsGE/x8O0usfp flmmN4rXwpDhd89GYPwmwfrPIkfHDL8= X-Google-Smtp-Source: APXvYqw5fsiZkTh+08IioKC6EPbF2suRpm3zMyr6lS461Uywu8XtPVPi66BxIARqHUGtcSaDS5HCLQ== X-Received: by 2002:a17:90a:ac0f:: with SMTP id o15mr14457288pjq.133.1581860928426; Sun, 16 Feb 2020 05:48:48 -0800 (PST) Received: from Abhishek-Arch.nitk.ac.in ([218.248.46.83]) by smtp.gmail.com with ESMTPSA id m12sm13302006pjf.25.2020.02.16.05.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 05:48:48 -0800 (PST) From: Abhishek Kumar To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [GSoC Patch 4/5] t4214: use lib-log-graph functions Date: Sun, 16 Feb 2020 19:17:49 +0530 Message-Id: <20200216134750.18947-4-abhishekkumar8222@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200216134750.18947-1-abhishekkumar8222@gmail.com> References: <20200216134750.18947-1-abhishekkumar8222@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Helped-by: Johannes Schindelin Signed-off-by: Abhishek Kumar --- t/t4214-log-graph-octopus.sh | 86 ++++++++---------------------------- 1 file changed, 19 insertions(+), 67 deletions(-) diff --git a/t/t4214-log-graph-octopus.sh b/t/t4214-log-graph-octopus.sh index 40d27db674..e85cf07d2c 100755 --- a/t/t4214-log-graph-octopus.sh +++ b/t/t4214-log-graph-octopus.sh @@ -3,6 +3,7 @@ test_description='git log --graph of skewed left octopus merge.' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-log-graph.sh test_expect_success 'set up merge history' ' test_commit initial && @@ -24,7 +25,7 @@ test_expect_success 'set up merge history' ' ' test_expect_success 'log --graph with tricky octopus merge, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order left octopus-merge <<-\EOF * left | *-. octopus-merge |/|\ \ @@ -37,14 +38,11 @@ test_expect_success 'log --graph with tricky octopus merge, no color' ' |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s left octopus-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with tricky octopus merge with colors' ' test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order left octopus-merge <<-\EOF * left | *-. octopus-merge |/|\ \ @@ -57,16 +55,13 @@ test_expect_success 'log --graph with tricky octopus merge with colors' ' |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s left octopus-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' # Repeat the previous two tests with "normal" octopus merge (i.e., # without the first parent skewing to the "left" branch column). test_expect_success 'log --graph with normal octopus merge, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order octopus-merge <<-\EOF *---. octopus-merge |\ \ \ | | | * 4 @@ -78,13 +73,11 @@ test_expect_success 'log --graph with normal octopus merge, no color' ' |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s octopus-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with normal octopus merge with colors' ' - cat >expect.colors <<-\EOF && + test_config log.graphColors red,green,yellow,blue,magenta,cyan && + test_cmp_colored_graph --pretty=tformat:%s --date-order octopus-merge <<-\EOF *---. octopus-merge |\ \ \ | | | * 4 @@ -96,14 +89,10 @@ test_expect_success 'log --graph with normal octopus merge with colors' ' |/ * initial EOF - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - git log --color=always --graph --date-order --pretty=tformat:%s octopus-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with normal octopus merge and child, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order after-merge <<-\EOF * after-merge *---. octopus-merge |\ \ \ @@ -116,13 +105,11 @@ test_expect_success 'log --graph with normal octopus merge and child, no color' |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s after-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with normal octopus and child merge with colors' ' - cat >expect.colors <<-\EOF && + test_config log.graphColors red,green,yellow,blue,magenta,cyan && + test_cmp_colored_graph --pretty=tformat:%s --date-order after-merge <<-\EOF * after-merge *---. octopus-merge |\ \ \ @@ -135,14 +122,10 @@ test_expect_success 'log --graph with normal octopus and child merge with colors |/ * initial EOF - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - git log --color=always --graph --date-order --pretty=tformat:%s after-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with tricky octopus merge and its child, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order left after-merge <<-\EOF * left | * after-merge | *-. octopus-merge @@ -156,14 +139,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child, no col |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s left after-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with tricky octopus merge and its child with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order left after-merge <<-\EOF * left | * after-merge | *-. octopus-merge @@ -177,13 +156,10 @@ test_expect_success 'log --graph with tricky octopus merge and its child with co |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s left after-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with crossover in octopus merge, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF * after-4 | *---. octopus-merge | |\ \ \ @@ -200,14 +176,11 @@ test_expect_success 'log --graph with crossover in octopus merge, no color' ' |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with crossover in octopus merge with colors' ' test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 octopus-merge <<-\EOF * after-4 | *---. octopus-merge | |\ \ \ @@ -224,13 +197,10 @@ test_expect_success 'log --graph with crossover in octopus merge with colors' ' |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s after-4 octopus-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with crossover in octopus merge and its child, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF * after-4 | * after-merge | *---. octopus-merge @@ -248,14 +218,11 @@ test_expect_success 'log --graph with crossover in octopus merge and its child, |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with crossover in octopus merge and its child with colors' ' test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order after-4 after-merge <<-\EOF * after-4 | * after-merge | *---. octopus-merge @@ -273,13 +240,10 @@ test_expect_success 'log --graph with crossover in octopus merge and its child w |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s after-4 after-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with unrelated commit and octopus tip, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order --pretty=tformat:%s after-initial octopus-merge <<-\EOF * after-initial | *---. octopus-merge | |\ \ \ @@ -296,14 +260,11 @@ test_expect_success 'log --graph with unrelated commit and octopus tip, no color |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with unrelated commit and octopus tip with colors' ' test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial octopus-merge <<-\EOF * after-initial | *---. octopus-merge | |\ \ \ @@ -320,13 +281,10 @@ test_expect_success 'log --graph with unrelated commit and octopus tip with colo |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s after-initial octopus-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_expect_success 'log --graph with unrelated commit and octopus child, no color' ' - cat >expect.uncolored <<-\EOF && + test_cmp_graph --pretty=tformat:%s --color=never --date-order after-initial after-merge <<-\EOF * after-initial | * after-merge | *---. octopus-merge @@ -344,14 +302,11 @@ test_expect_success 'log --graph with unrelated commit and octopus child, no col |/ * initial EOF - git log --color=never --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.raw && - sed "s/ *\$//" actual.raw >actual && - test_cmp expect.uncolored actual ' test_expect_success 'log --graph with unrelated commit and octopus child with colors' ' test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && + test_cmp_colored_graph --pretty=tformat:%s --date-order after-initial after-merge <<-\EOF * after-initial | * after-merge | *---. octopus-merge @@ -369,9 +324,6 @@ test_expect_success 'log --graph with unrelated commit and octopus child with co |/ * initial EOF - git log --color=always --graph --date-order --pretty=tformat:%s after-initial after-merge >actual.colors.raw && - test_decode_color actual.colors && - test_cmp expect.colors actual.colors ' test_done From patchwork Sun Feb 16 13:47:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Kumar X-Patchwork-Id: 11384447 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 8A92B197C for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B942206E2 for ; Sun, 16 Feb 2020 13:48:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QngFbvME" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728175AbgBPNsx (ORCPT ); Sun, 16 Feb 2020 08:48:53 -0500 Received: from mail-pj1-f51.google.com ([209.85.216.51]:37183 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727933AbgBPNsx (ORCPT ); Sun, 16 Feb 2020 08:48:53 -0500 Received: by mail-pj1-f51.google.com with SMTP id m13so6045381pjb.2 for ; Sun, 16 Feb 2020 05:48:51 -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=Yj3ZtAaKjuh5f9SqEwGaI4zuWboa1Ku3MPN06Z2LMoY=; b=QngFbvMExCv4tOq9OMHUrkEUvGGyqtkMsaMG+hp/JsFQ3vAFhfixPSL3qGVO+D8rMz qww1+6BBA0sadevJZGr/zdy0cOtjcn/LiXXPAcEDgeoQfuqzqnWdscPiNJVNgGzEAv2Y 2qMc/BFQUp5whKCHnkYtai60scZ9wH1AHu+wZmCDHD/sVTAOczqNpgTZkyuWpPl4tw8P lMllj2yZ7grdncgfAlDmZnfwh2nBsYY3RoRG3Gcvu9hAY4xrTvaBywM/w802FgUVsU0/ QE9wPHApBgeoowQjjogSpaxMNTDfvavsAYs2WhCsk20h62DpUWzU/rXoMo7AEH9j7BHc LqAQ== 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=Yj3ZtAaKjuh5f9SqEwGaI4zuWboa1Ku3MPN06Z2LMoY=; b=OpKFKrE0mZAQK85ggYxyaJl3TcY23Dpbf5qwEI/aFbtmi6ycdHUJdtKQ5jclgDFLbJ yt+ViijPKDaMnBfW8VQLU/luR/dy514MpomE0FAVsicLdwBFd22MMf6iYnXyz2vh6YLO Ryp99Yac99UFZXFIj2wR0x0AV4nH1QWE6qIE/io4vf8OsO3EUK+7ml+yNtf10RWKQ4AG FC/WNvq08FP38apF2+6zesC7DArLo84N41M60iHie7MTN5q401CAr/IBgONahpirKFXX vVOblQHhD2XCWLZY1OkM7IJZrwxOiZSx4EhbwC2GlG3w5eNMb/8hoDxOZTbNWDgvpzIv muhQ== X-Gm-Message-State: APjAAAXi6Ac3m5F3KB97dX7oU3ZILji7Tb+5Fxuo4UvlEJDj271tqY3N ZRtaqOA68DQuNkI52fXklufPjKKTKkc= X-Google-Smtp-Source: APXvYqyUBJLM8jvHXH7ScMo6S4t/ccyNCcEsq0NZPjwaVIVUqhcoX6QSni3yPYma0bV+tGIgcLgJrA== X-Received: by 2002:a17:90a:1785:: with SMTP id q5mr14781455pja.143.1581860930491; Sun, 16 Feb 2020 05:48:50 -0800 (PST) Received: from Abhishek-Arch.nitk.ac.in ([218.248.46.83]) by smtp.gmail.com with ESMTPSA id m12sm13302006pjf.25.2020.02.16.05.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 05:48:50 -0800 (PST) From: Abhishek Kumar To: git@vger.kernel.org Cc: Johannes Schindelin Subject: [GSoC Patch 5/5] t4202: use lib-log-graph functions Date: Sun, 16 Feb 2020 19:17:50 +0530 Message-Id: <20200216134750.18947-5-abhishekkumar8222@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200216134750.18947-1-abhishekkumar8222@gmail.com> References: <20200216134750.18947-1-abhishekkumar8222@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Helped-by: Johannes Schindelin Signed-off-by: Abhishek Kumar --- t/t4202-log.sh | 49 ++++++++++--------------------------------------- 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 192347a3e1..403d88bb33 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -5,6 +5,7 @@ test_description='git log' . ./test-lib.sh . "$TEST_DIRECTORY/lib-gpg.sh" . "$TEST_DIRECTORY/lib-terminal.sh" +. "$TEST_DIRECTORY/lib-log-graph.sh" test_expect_success setup ' @@ -452,8 +453,7 @@ cat > expect <actual && - test_cmp expect actual + test_cmp_graph_file --pretty=tformat:%s ' cat > expect < expect <actual && - test_cmp expect actual + test_cmp_graph_file --line-prefix="123 " --pretty=tformat:%s ' test_expect_success 'set up merge history' ' @@ -495,9 +494,7 @@ cat > expect <<\EOF EOF test_expect_success 'log --graph with merge' ' - git log --graph --date-order --pretty=tformat:%s | - sed "s/ *\$//" >actual && - test_cmp expect actual + test_cmp_graph_file --date-order --pretty=tformat:%s ' cat > expect <<\EOF @@ -516,9 +513,7 @@ cat > expect <<\EOF EOF test_expect_success 'log --graph --line-prefix="| | | " with merge' ' - git log --line-prefix="| | | " --graph --date-order --pretty=tformat:%s | - sed "s/ *\$//" >actual && - test_cmp expect actual + test_cmp_graph_file --line-prefix="| | | " --date-order --pretty=tformat:%s ' cat > expect.colors <<\EOF @@ -538,9 +533,7 @@ EOF test_expect_success 'log --graph with merge with log.graphColors' ' test_config log.graphColors " blue,invalid-color, cyan, red , " && - git log --color=always --graph --date-order --pretty=tformat:%s | - test_decode_color | sed "s/ *\$//" >actual && - test_cmp expect.colors actual + test_cmp_colored_graph_file --date-order --pretty=tformat:%s ' test_expect_success 'log --raw --graph -m with merge' ' @@ -1213,24 +1206,8 @@ cat >expect <<\EOF +one EOF -sanitize_output () { - sed -e 's/ *$//' \ - -e 's/commit [0-9a-f]*$/commit COMMIT_OBJECT_NAME/' \ - -e 's/Merge: [ 0-9a-f]*$/Merge: MERGE_PARENTS/' \ - -e 's/Merge tag.*/Merge HEADS DESCRIPTION/' \ - -e 's/Merge commit.*/Merge HEADS DESCRIPTION/' \ - -e 's/, 0 deletions(-)//' \ - -e 's/, 0 insertions(+)//' \ - -e 's/ 1 files changed, / 1 file changed, /' \ - -e 's/, 1 deletions(-)/, 1 deletion(-)/' \ - -e 's/, 1 insertions(+)/, 1 insertion(+)/' \ - -e 's/index [0-9a-f]*\.\.[0-9a-f]*/index BEFORE..AFTER/' -} - test_expect_success 'log --graph with diff and stats' ' - git log --no-renames --graph --pretty=short --stat -p >actual && - sanitize_output >actual.sanitized expect <<\EOF @@ -1505,9 +1482,7 @@ cat >expect <<\EOF EOF test_expect_success 'log --line-prefix="*** " --graph with diff and stats' ' - git log --line-prefix="*** " --no-renames --graph --pretty=short --stat -p >actual && - sanitize_output >actual.sanitized expect <<-\EOF @@ -1529,9 +1504,7 @@ cat >expect <<-\EOF EOF test_expect_success 'log --graph with --name-status' ' - git log --graph --format=%s --name-status tangle..reach >actual && - sanitize_output actual.sanitized && - test_cmp expect actual.sanitized + test_cmp_graph_file --pretty=tformat:%s --name-status tangle..reach ' cat >expect <<-\EOF @@ -1553,9 +1526,7 @@ cat >expect <<-\EOF EOF test_expect_success 'log --graph with --name-only' ' - git log --graph --format=%s --name-only tangle..reach >actual && - sanitize_output actual.sanitized && - test_cmp expect actual.sanitized + test_cmp_graph_file --pretty=tformat:%s --name-only tangle..reach ' test_expect_success 'dotdot is a parent directory' '