From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id F082B1F4B5 for ; Wed, 20 Nov 2019 00:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727574AbfKTAvW (ORCPT ); Tue, 19 Nov 2019 19:51:22 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:35044 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727226AbfKTAvW (ORCPT ); Tue, 19 Nov 2019 19:51:22 -0500 Received: by mail-pj1-f65.google.com with SMTP id s8so3402412pji.2 for ; Tue, 19 Nov 2019 16:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1ABxWWyvohAslzq6J5HDDQ3MDaiMrpY8anuSFIFS94I=; b=UieqIeW2vAClgjJRtHMGiw/zKCnhmC8YOoVtYlc3SlTvKK6QJofB6e+hkjhsBj46Aq qxUGgxe3NzY7iTn3zVw5KB4i8nBJETlcfXFf89alwewsMgo2I5f11k9fuKa6Pkb2/9Un 7pVQ/EXnnGGZJ/540i/rQfs6RGOdXb9/gFMqRB0VyK4+H0YN+RUp9pTNEQsBdR3seJvU XE3vKLnMWVKrJo4I829Ba8S7DkYLNcKD8eKBWYjnzEL0jECbuBWzb4N1FwK+htab9LXd 2YKxY+l6gJVInalOpuTuDpEJBG7EeOt1LXs5F1KbKhsi1ZZyd6BsPSluKgZ1VZbBE0mw 23lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1ABxWWyvohAslzq6J5HDDQ3MDaiMrpY8anuSFIFS94I=; b=OhW+O879HcG/7GAID+hewIdYlwAVQusQrMofEM/qIWiQOor1SsJC54ielGnJGGnTgM Tpid2Id7/rNS41kDKhGYJI0736yV6MP57Wqq3IXvw2xlRvpmReJRgrRj7grMXJPlBV1q zOoIMksjN0MUnU6jbqnY3Ab+5MQNAEoO6q9Yxo6VGuF583W1dFXNUEibIfu8oBuNu5Cm EWcuNNPKlb4ipRWpWMI+qjUYz5ZNGt3pb4KEI7D6lwTUx8iLyowADLyNkOuWQD9U25Bs wlzGnUvVbVjIko9LX0jl9BVe0pjZmjoHk/80Qp+URiAe2kYk9IlhDLpsqSZjAwyri3Mm ANbA== X-Gm-Message-State: APjAAAU/2A9CCEbiOrbVjBL/YKpEPDxfffKtv4gOgyxxpdrD0AR3I8bQ DL0rEuascyT9s+nkAa17lajlWAeb X-Google-Smtp-Source: APXvYqxKPSi4FTihF6WJxXXRCqyach64v7ay/g6m/x/BSSZXPLZUg9GmWIRNq9wLBp9qDqC0CZSumQ== X-Received: by 2002:a17:90a:fb57:: with SMTP id iq23mr486506pjb.79.1574211080862; Tue, 19 Nov 2019 16:51:20 -0800 (PST) Received: from generichostname ([204.14.239.83]) by smtp.gmail.com with ESMTPSA id p9sm27245780pfq.40.2019.11.19.16.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 16:51:20 -0800 (PST) Date: Tue, 19 Nov 2019 16:51:18 -0800 From: Denton Liu To: Git Mailing List Cc: Eric Sunshine , Junio C Hamano , =?utf-8?B?UmVuw6k=?= Scharfe , SZEDER =?utf-8?B?R8OhYm9y?= , Todd Zullinger Subject: [PATCH v5 07/11] t4205: cover `git log --reflog -z` blindspot Message-ID: <1519677b30f7a543141c7a0c313c6a965c616a58.1574211027.git.liu.denton@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The test suite does not include any tests where `--reflog` and `-z` are used together in `git log`. Cover this blindspot. Note that the `--pretty=oneline` case is written separately because it follows a slightly different codepath. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- t/t4205-log-pretty-formats.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index f42a69faa2..0335b428b1 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -134,6 +134,36 @@ test_expect_failure C_LOCALE_OUTPUT 'NUL termination with --stat' ' test_cmp expected actual ' +for p in short medium full fuller email raw +do + test_expect_success "NUL termination with --reflog --pretty=$p" ' + revs="$(git rev-list --reflog)" && + for r in $revs + do + git show -s "$r" --pretty="$p" && + printf "\0" || return 1 + done >expect && + { + git log -z --reflog --pretty="$p" && + printf "\0" + } >actual && + test_cmp expect actual + ' +done + +test_expect_success 'NUL termination with --reflog --pretty=oneline' ' + revs="$(git rev-list --reflog)" && + for r in $revs + do + git show -s --pretty=oneline "$r" >raw && + cat raw | lf_to_nul || exit 1 + done >expect && + # the trailing NUL is already produced so we do not need to + # output another one + git log -z --pretty=oneline --reflog >actual && + test_cmp expect actual +' + test_expect_success 'setup more commits' ' test_commit "message one" one one message-one && test_commit "message two" two two message-two && -- 2.24.0.420.g9ac4901264