From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3672A2F7F12 for ; Wed, 8 Jul 2026 20:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783543273; cv=none; b=Zpf+nztxtKusHJ/mvpwSE5c8OJow68ZkwtQSKpcQhvBuLjiiYN2c+j3rgOyj6U+J2mV//BP7hrndI8qMq7vT/gqfU4YBvHpjSYhLxDbhkWfQHv6KGkjOuRzDkhI+bPhJ08VZRmU3naHjH0sd2U8qpzcMxlEMeJAVLJViLC/UBG4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783543273; c=relaxed/simple; bh=WNA8hZmDIsipFqFZvWKVMtudY0it8moD0sgT/sy5CkM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=oq8C87F3nYV2TAbAT0EGDv7vieiQySA+InNj9/8nYKck0/3dQDq4zl0GD2y0qQCqbYm8IgWabRlGyFskA8pbHuES+yUjwBNmUYF4HgN7XU2bJjNjYPf7Q/vOrCBF3IDm8NKR/UQk4Bx3m4mday0AcHMKLeVFbl0S/kZIN7iFt1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=qzZXZZd+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cobQSrLe; arc=none smtp.client-ip=202.12.124.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="qzZXZZd+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cobQSrLe" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 856BD7A00D9; Wed, 8 Jul 2026 16:41:11 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-05.internal (MEProxy); Wed, 08 Jul 2026 16:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1783543271; x=1783629671; bh=X4nEzE7O2o hMSpujqIRFQSXZCvN89bbgrtfoVQsEVTk=; b=qzZXZZd+bCZ4g+Fufl6RsEQ14b 4F5f6z7Hj+BUYu4DmKsNIQZ/8T758b+Ll6ArA8oez/NGmbVLFnJ5mwyDyjtd/aAA ZXomealNe7LZf0YUL479OVC8Udlz2b79Ps+Of2K/hCXPmd3bvLSNxNH7s5mB9qky TCNGuYg0UAps6k/K8eNSMOTQ7B5U/6BRT8qJDLme1HPuW2rwig9yNepnMx8kkRfB uGO83Ef1WLpd/vIkDSZAv4vjj+fKPR/hvpRi1gyc4kTPkVAae1SkMOzaTJQdw1tr DddcrUh6g8upoOFetLgW460XdU9KpT2DXSubuWDk/joFHJAXOI9AnAYpzAvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1783543271; x=1783629671; bh=X4nEzE7O2oh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XQVVo5aZ8mHPg1zQmMCzq9bxdkTr2rUzh+A X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jul 2026 16:41:10 -0400 (EDT) From: Junio C Hamano To: Gatla Vishweshwar Reddy Cc: git@vger.kernel.org Subject: Re: [PATCH v3] t1410-reflog.sh: avoid suppressing git's exit code in pipelines In-Reply-To: <20260708092448.35776-1-gatlavishweshwarreddy26@gmail.com> (Gatla Vishweshwar Reddy's message of "Wed, 8 Jul 2026 14:50:05 +0530") References: <20260708092448.35776-1-gatlavishweshwarreddy26@gmail.com> Date: Wed, 08 Jul 2026 13:41:09 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Gatla Vishweshwar Reddy writes: > Piping git commands directly to wc -l suppresses the exit code of > git, hiding potential failures from the test suite. Correct. > Capture the > output to a temporary file first, then count the lines separately > to preserve the exit code. Where the expected count is known ahead > of time, use test_stdout_line_count instead. Technically, the description is not telling any lies about the solution, but the patch no longer does the caputuring or counting itself at all. Rather, it exclusively uses test_stdout_line_count, which internally does the saving to a temporary and counting the lines ;-) The changes in the patch are mostly good, except for the loss of a blank line that separates two test pieces in the last hunk (below). > @@ -319,13 +311,12 @@ test_expect_success 'git reflog expire unknown reference' ' > test_must_fail git reflog expire does-not-exist 2>stderr && > test_grep "error: reflog could not be found: ${SQ}does-not-exist${SQ}" stderr > ' > - > test_expect_success 'checkout should not delete log for packed ref' ' > - test $(git reflog main | wc -l) = 4 && > + test_stdout_line_count = 4 git reflog main && > git branch foo && > git pack-refs --all && > git checkout foo && > - test $(git reflog main | wc -l) = 4 > + test_stdout_line_count = 4 git reflog main > ' > > test_expect_success 'stale dirs do not cause d/f conflicts (reflogs on)' ' Thanks.