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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 6A7FE1F670 for ; Fri, 22 Oct 2021 00:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbhJVAcG (ORCPT ); Thu, 21 Oct 2021 20:32:06 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:65511 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbhJVAcF (ORCPT ); Thu, 21 Oct 2021 20:32:05 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id DD4BE1515C2; Thu, 21 Oct 2021 20:29:48 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=z5+sw6HVYsU+M22w973mAAZJQlkRwZcwSuLXkx QKQjs=; b=H5rjmKfA2CkLD05Hmxm8AasGIDlAgjUXWT9gvkUijrEVLcOzyopgm7 opFj4KwwDxkazrA4D+p452R+DeP1hWJGNTjNEH3g6NDOthx59a/waVESKgRoEUp0 o8uGh/RDhN5msRiSTXLRoPfwSEZ7POiY0XEKCm6Uk8DD/o9SEI1Sw= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id D70AC1515C1; Thu, 21 Oct 2021 20:29:48 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 319501515C0; Thu, 21 Oct 2021 20:29:46 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Eric Sunshine Cc: =?utf-8?Q?=C3=98ystein?= Walle , Git List Subject: Re: [PATCH 2/2] status: print stash info with --porcelain=v2 --show-stash References: <20211021222532.463375-1-oystwa@gmail.com> <20211021222532.463375-3-oystwa@gmail.com> Date: Thu, 21 Oct 2021 17:29:45 -0700 In-Reply-To: (Eric Sunshine's message of "Thu, 21 Oct 2021 20:05:53 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 28962B30-32CF-11EC-979B-F327CE9DA9D6-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Eric Sunshine writes: >> + test_when_finished "git stash pop && git stash pop" && > > If it's indeed important to clean up the stashes when the test > finishes, then the test_when_finished() invocation should probably be > a bit more robust... > >> + git stash -- file_x && >> + git stash && > > ... since, as it is now, if an error occurs between these two > git-stash invocations or before them, then there will only be zero or > one stashes, so the double stash-pop by test_when_finished() will > itself errout out. Better, perhaps to do this: > > test_when_finished "git stash pop && git stash pop || :" && > >> + git status --porcelain=v2 --branch --show-stash --untracked-files=no >actual && >> + test_cmp expect actual >> +' There is no "I do not care what is in the stash right now, just clear all"?