From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 05DAC20196 for ; Thu, 14 Jul 2016 15:45:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751538AbcGNPpT (ORCPT ); Thu, 14 Jul 2016 11:45:19 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:57399 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751149AbcGNPpR (ORCPT ); Thu, 14 Jul 2016 11:45:17 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id F21C12A169; Thu, 14 Jul 2016 11:45:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=XnXzatuGGyNRN9BVAqkAzhCHPsk=; b=SYzYXg nZMBTusXURc4m4w/uYK2C1+lJO47RpgldFZeLMRSrUfZKeYpuPiNxsxcfQgkCxvu p3N0vqpAEBYQyPrblTW/i72SXsTAYDvpC+Wdi9o/ftSpthROnE5DX5qGODHDOxno HNgMSeTCsSM47jc+5uQklbUn9Li7EoVcrnoI4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=YqYJJaMwfSdGeRkmNI5ZRD84CIVl5KPF /klR0MRO4BQfVFRul2Bblgka+WFC8egH9xQgXzxLLX6pfwkP0NQLESrfiJ5f6btm aFXgdcEwRBpcmU1cQCEjq1xEUmdinh8qG2eBroz/X4WkmXk7HbBruRYqlVF+Jo39 uWNx++EyLM4= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id EABD22A168; Thu, 14 Jul 2016 11:45:15 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 688342A165; Thu, 14 Jul 2016 11:45:15 -0400 (EDT) From: Junio C Hamano To: Johannes Schindelin Cc: git@vger.kernel.org Subject: Re: What's cooking in git.git (Jul 2016, #05; Wed, 13) References: Date: Thu, 14 Jul 2016 08:45:13 -0700 In-Reply-To: (Johannes Schindelin's message of "Thu, 14 Jul 2016 15:15:13 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: F5595474-49D9-11E6-92C6-89D312518317-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Johannes Schindelin writes: > + ret = add_cache_entry(ce, options); > + if (refresh) { > > Should we really refresh, even if ret < 0? As we stopped calling make_cache_entry() with REFRESH flag on, we can change this not to refresh if we want to, and I think we can skip refresh without compromising correctness. But I'd prefer to see that change as a separate "optimization" step---after all, the original before this change unconditionally refreshed before even calling add_cache_entry() and knowing the result of it. > + struct cache_entry *nce; > + > + nce = refresh_cache_entry(ce, CE_MATCH_REFRESH | CE_MATCH_IGNORE_MISSING); > > This line is overly long, but there is a *lot* of precedent for that in > merge-recursive.c, unfortunately. So this is just a remark, not an > objection. Yes, I had the same objection to the original codebase while I was touching it. Thanks.