git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v1] dir: create function count_slashes

From
Stefan Beller <sbeller@google.com>
Date
Jun 12, 2017, 05:33 UTC
Message-ID
<CAGZ79kaKfdeyM41S2huGwYq8z3brRVpotA-CZzYe429-cA=mZg@mail.gmail.com>
In-Reply-To
<20170608180812.6678-1-pc44800@gmail.com>
On Thu, Jun 8, 2017 at 11:08 AM, Prathamesh Chavan <pc44800@gmail.com> wrote:
Show 15 quoted lines
> Similar functions exist in apply.c and builtin/show-branch.c for
> counting the number of slashes in a string. Also in the later
> patches, we introduce a third caller for the same. Hence, we unify
> it now by cleaning the existing functions and declaring a common
> function count_slashes in dir.h and implementing it in dir.c to
> remove this code duplication.
>
> Mentored-by: Christian Couder <christian.couder@gmail.com>
> Mentored-by: Stefan Beller <sbeller@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Prathamesh Chavan <pc44800@gmail.com>
> ---
> In future, I intend to use this function in builtin/submodule--helper.c
> as well, hence this change was introduced now.
>
Thanks for upstreaming this early!

I think this is a good change even without the submodule work thrown into the soup as well, but with the given promise to have it used a third time this is a no-brainer later on.

Previous: Prathamesh Chavan
Message 2 of 2 in “dir: create function count_slashes”
  1. dir: create function count_slashesPrathamesh Chavan, Jun 8, 2017
  2. Stefan BellerJun 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.