From patchwork Wed Aug 12 19:44:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shourya Shukla X-Patchwork-Id: 11711281 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ACF6E14E3 for ; Wed, 12 Aug 2020 19:44:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92D0C20866 for ; Wed, 12 Aug 2020 19:44:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J6cObPTc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbgHLTo2 (ORCPT ); Wed, 12 Aug 2020 15:44:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbgHLTo2 (ORCPT ); Wed, 12 Aug 2020 15:44:28 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C3CBC061383 for ; Wed, 12 Aug 2020 12:44:28 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 74so1526321pfx.13 for ; Wed, 12 Aug 2020 12:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f5tz4muLPsQXMqQZAFj1rC+PmGmwn43+GIIj65b/ZPE=; b=J6cObPTcWUih7VKDo8WPlCtcq040sOhfz112AUG4wXwLu0lQonEkhp3djragLzO//o Yvxwu3GZAoECigF3GHI6CIirSx6FwQvWR7fHBZMyytEEPVk7XXugPIv8aZSSwsk2xco/ PTHdBEeDfSRA7NjfQFqxAJFV0kA05zIqsm2UvZ53ZcBYD0rmXCxkM9e80nh9vVjWUNt1 GegJk2xaxsdzRSsGBO1d6Ca6tEfAKu25RsfqR7UdqrrvnjpyxJ83uAApMDpWx1ZQG4yr 6GebKdUcP2YFsAh6QZk2nb00V+enCQh1d4keJECiOvJ+2negoUSf8ySZwucwG9KVRzfM HGOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f5tz4muLPsQXMqQZAFj1rC+PmGmwn43+GIIj65b/ZPE=; b=DbthBBhWRGisssrKqvrXW7vS1TuCLAYEEff+IJYn0WBjaMKLo5fQA0ld4inHuYw7LD MKRJU0/IO8HtSKC8Ybi1hcvNXEsF3H8h28rVsmP+jLxlsZ/bE2VMmn1L20+9di2fo6S+ y17Xh2GGaMIAyiqmWuN13lD2LezrCBB7ynmnQNtrWLO7rJnP9DfKJcJ1Zp+ir2nzDz9y 8GB8xCZBgxZnN287Rcczz+yxhVKiPt0UiLy5MA6vlbfUGMLBKDmtL/8ByzumMkpPHxJk dsiOGgH4FF7iB+7dv1ncWhFX3lFx5oJPcUI02L9z5BTYgePF4XDIcgUnJ6DcCJvm7kpx MDfg== X-Gm-Message-State: AOAM5320grTMi/Ai9Y61Qts9dy6C+IkOz/FgoWgfhh8j8DVWi5btpbFD VBHEpjOpHfiPRF15atVTcLE= X-Google-Smtp-Source: ABdhPJzu60HHSR1tjANVXwfNvcAxrtuSrb5eTjw6alTrU4h6aV0lJV5j5g0PK0GYnHOoEsXUu8Dv2w== X-Received: by 2002:a63:3589:: with SMTP id c131mr665848pga.158.1597261467691; Wed, 12 Aug 2020 12:44:27 -0700 (PDT) Received: from localhost.localdomain ([45.127.46.132]) by smtp.gmail.com with ESMTPSA id q17sm3183965pfh.32.2020.08.12.12.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 12:44:27 -0700 (PDT) From: Shourya Shukla To: shouryashukla.oo@gmail.com Cc: christian.couder@gmail.com, git@vger.kernel.org, gitster@pobox.com, Johannes.Schindelin@gmx.de, kaartic.sivaraam@gmail.com, liu.denton@gmail.com, Christian Couder Subject: [PATCH v3 2/4] submodule: rename helper functions to avoid ambiguity Date: Thu, 13 Aug 2020 01:14:02 +0530 Message-Id: <20200812194404.17028-3-shouryashukla.oo@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200812194404.17028-1-shouryashukla.oo@gmail.com> References: <20200806164102.6707-1-shouryashukla.oo@gmail.com> <20200812194404.17028-1-shouryashukla.oo@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The helper functions: show_submodule_summary(), prepare_submodule_summary() and print_submodule_summary() are used by the builtin_diff() function in diff.c to generate a summary of submodules in the context of a diff. Functions with similar names are to be introduced in the upcoming port of submodule's summary subcommand. So, rename the helper functions to '*_diff_submodule_summary()' to avoid ambiguity. Mentored-by: Christian Couder Mentored-by: Kaartic Sivaraam Signed-off-by: Shourya Shukla --- diff.c | 2 +- submodule.c | 10 +++++----- submodule.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/diff.c b/diff.c index f9709de7b4..46175e40a6 100644 --- a/diff.c +++ b/diff.c @@ -3429,7 +3429,7 @@ static void builtin_diff(const char *name_a, if (o->submodule_format == DIFF_SUBMODULE_LOG && (!one->mode || S_ISGITLINK(one->mode)) && (!two->mode || S_ISGITLINK(two->mode))) { - show_submodule_summary(o, one->path ? one->path : two->path, + show_submodule_diff_summary(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); return; diff --git a/submodule.c b/submodule.c index a52b93a87f..8273647b73 100644 --- a/submodule.c +++ b/submodule.c @@ -438,7 +438,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt, */ } -static int prepare_submodule_summary(struct rev_info *rev, const char *path, +static int prepare_submodule_diff_summary(struct rev_info *rev, const char *path, struct commit *left, struct commit *right, struct commit_list *merge_bases) { @@ -459,7 +459,7 @@ static int prepare_submodule_summary(struct rev_info *rev, const char *path, return prepare_revision_walk(rev); } -static void print_submodule_summary(struct repository *r, struct rev_info *rev, struct diff_options *o) +static void print_submodule_diff_summary(struct repository *r, struct rev_info *rev, struct diff_options *o) { static const char format[] = " %m %s"; struct strbuf sb = STRBUF_INIT; @@ -610,7 +610,7 @@ static void show_submodule_header(struct diff_options *o, strbuf_release(&sb); } -void show_submodule_summary(struct diff_options *o, const char *path, +void show_submodule_diff_summary(struct diff_options *o, const char *path, struct object_id *one, struct object_id *two, unsigned dirty_submodule) { @@ -632,12 +632,12 @@ void show_submodule_summary(struct diff_options *o, const char *path, goto out; /* Treat revision walker failure the same as missing commits */ - if (prepare_submodule_summary(&rev, path, left, right, merge_bases)) { + if (prepare_submodule_diff_summary(&rev, path, left, right, merge_bases)) { diff_emit_submodule_error(o, "(revision walker failed)\n"); goto out; } - print_submodule_summary(sub, &rev, o); + print_submodule_diff_summary(sub, &rev, o); out: if (merge_bases) diff --git a/submodule.h b/submodule.h index 9ce85c03fe..4ac6e31cf1 100644 --- a/submodule.h +++ b/submodule.h @@ -69,7 +69,7 @@ int parse_submodule_update_strategy(const char *value, struct submodule_update_strategy *dst); const char *submodule_strategy_to_string(const struct submodule_update_strategy *s); void handle_ignore_submodules_arg(struct diff_options *, const char *); -void show_submodule_summary(struct diff_options *o, const char *path, +void show_submodule_diff_summary(struct diff_options *o, const char *path, struct object_id *one, struct object_id *two, unsigned dirty_submodule); void show_submodule_inline_diff(struct diff_options *o, const char *path,