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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id EDC8D1F59D for ; Wed, 3 Aug 2022 17:32:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238129AbiHCRcU (ORCPT ); Wed, 3 Aug 2022 13:32:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236436AbiHCRcT (ORCPT ); Wed, 3 Aug 2022 13:32:19 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C6D1DA75 for ; Wed, 3 Aug 2022 10:32:17 -0700 (PDT) Received: (qmail 8341 invoked by uid 109); 3 Aug 2022 17:32:17 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 03 Aug 2022 17:32:17 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 13234 invoked by uid 111); 3 Aug 2022 17:32:17 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 03 Aug 2022 13:32:17 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 3 Aug 2022 13:32:16 -0400 From: Jeff King To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Junio C Hamano , Eric Sunshine Subject: Re: [PATCH v3 4/6] log: refactor "rev.pending" code in cmd_show() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Aug 02, 2022 at 05:33:14PM +0200, Ævar Arnfjörð Bjarmason wrote: > * We don't need the "count" and "objects" variables introduced in > 5d7eeee2ac6 (git-show: grok blobs, trees and tags, too, 2006-12-14). > > They were originally added since we'd clobber rev.pending in the > loop without restoring it. Since the preceding commit we are > restoring it when we handle OBJ_COMMIT, so the main for-loop can > refer to "rev.pending" didrectly. I think this is accurate, though it does feel a bit weird that we are iterating over rev.pending, and we clobber and restore it mid-loop. It's correct because of the restore, but I think that's why my gut feeling favored the earlier approach to completely dissociate the iteration variables from "rev.pending" before the loop even starts. That said, it seems like we're spending a lot more time going back and forth on this topic than it is really worth, so I can live with any of the versions. -Peff