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.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 7E5A21F4CE for ; Wed, 13 Apr 2022 20:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234421AbiDMUJM (ORCPT ); Wed, 13 Apr 2022 16:09:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiDMUJJ (ORCPT ); Wed, 13 Apr 2022 16:09:09 -0400 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C8217B10B for ; Wed, 13 Apr 2022 13:06:47 -0700 (PDT) Received: by mail-pf1-f177.google.com with SMTP id w7so2921681pfu.11 for ; Wed, 13 Apr 2022 13:06:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RLNmvB0rpWAcnVz79IyBMkrGNLL6lSvdZeetIIbJAfY=; b=DC0IT8n7rbIVdm0gfDFIO0Oo8hPvxx9vx/qccfCnG3GrAs6PoEDsNS+TyX1e6IGUnq 9tMa+02Y1L4sgIBu398Ih35HlDrmnH6ZxDyOgOC2NNm6qAXn4dU+HU3QUi1VkaJWGrhO Xj9CjQemnoju0fJussaXdyxmvpmkXbzD19PfoCZ8f46X0SwbSGWtQWd5kRtH8V0jjGpQ 8BQ1O09EasQGQpFv3YTDwE59dywS89rIo1ppYS/YLX630HP1VBsS/FC86b1Bbu9u3lVe pu5ohJdzaodNKcHxsxxGHVRRoJTYXCJ2W/tHzjJgMhvYzRR9VqAJJgBPtS0Qo27UwCFi 35Yg== X-Gm-Message-State: AOAM533VcFqu8kQ9HA5tOloYbt03FJ8AdDNmSW1r6Uml+r9sv1OH5msM Veab8V0KYH/HbEEbiI/YJXgBJY54XmN0t7X8ASc= X-Google-Smtp-Source: ABdhPJypCgoZDDJUTUuP2iKuTl+37HCT6zw8vYAuWf8HYsYL+8t/Zbi6uOwwqUTtHkDgA1mA7b5cM+Osem/oPE+SFdQ= X-Received: by 2002:a05:6a00:23d2:b0:4fa:f262:719 with SMTP id g18-20020a056a0023d200b004faf2620719mr502803pfc.4.1649880406487; Wed, 13 Apr 2022 13:06:46 -0700 (PDT) MIME-Version: 1.0 References: <20220413164336.101390-1-eantoranz@gmail.com> In-Reply-To: From: Eric Sunshine Date: Wed, 13 Apr 2022 16:06:35 -0400 Message-ID: Subject: Re: [RFC] introducing git replay To: Junio C Hamano Cc: Edmundo Carmona Antoranz , Git List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Apr 13, 2022 at 3:27 PM Junio C Hamano wrote: > Edmundo Carmona Antoranz writes: > > +static unsigned int replay_indexof(struct commit *commit, > > + struct commit_list *list) > > +{ > > + int res; > > + if (list == NULL) > > + return -1; > > We encourage to have a blank line between the end of the decls and > the beginning of the statements. Add one after the line that > declares the variable "res". > > In an existing code that consistently uses the abbreviation, it is a > different story, but "result" is not too long to spell out, and > because you do not use the variable that often anyway, you would > avoid unnecessary friction on the readers not to abbreviate it to > "res" here. One other minor point... in Git source code, comparison against NULL is spelled: if (!list) ... (And the inverse case of `if (list != NULL)` would just be `if (list)`.)