# Subject: [PATCH] config: mark a file-local symbol as static

3 messages from 2017-06-15 to 2017-06-17. Participants: Ramsay Jones, Sahil Dua.
Thread: https://gitlist.dev/t/46184

## Ramsay Jones, 2017-06-15 01:20

Subject: Subject: [PATCH] config: mark a file-local symbol as static
Message-ID: <7d11fa4e-232b-8741-504f-ab4e3e788130@ramsayjones.plus.com>
URL: https://gitlist.dev/e/7d11fa4e-232b-8741-504f-ab4e3e788130%40ramsayjones.plus.com

```

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Sahil,

If you need to re-roll your 'sd/branch-copy' branch, could you please
squash this into the relevant patch (commit 37af9c71b6, "config: create
a function to format section headers", 13-06-2017).

Also, I note that another patch in that branch (commit fd44da469c,
"branch: add a --copy (-c) option to go with --move (-m)", 13-06-2017),
adds a couple of external symbols which, currently, don't need to be
externally visible. Is it intended that git_config_copy_section_in_file()
and refs_copy_existing_ref() be part of the public API?

Thanks!

ATB,
Ramsay Jones

 config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config.c b/config.c
index 2996e6d56..fbba17483 100644
--- a/config.c
+++ b/config.c
@@ -2173,7 +2173,7 @@ static int write_error(const char *filename)
 	return 4;
 }
 
-struct strbuf store_create_section(const char *key)
+static struct strbuf store_create_section(const char *key)
 {
 	const char *dot;
 	int i;
-- 
2.13.0

```

## Sahil Dua, 2017-06-17 21:40

Subject: Re: Subject: [PATCH] config: mark a file-local symbol as static
Message-ID: <CALiud+nZj4f1=puzXC6grfStg-tQLMGpr-dAdtNwphyvts5KmA@mail.gmail.com>
URL: https://gitlist.dev/e/CALiud%2BnZj4f1%3DpuzXC6grfStg-tQLMGpr-dAdtNwphyvts5KmA%40mail.gmail.com
In-Reply-To: <7d11fa4e-232b-8741-504f-ab4e3e788130@ramsayjones.plus.com>

```
Hi Ramsay,

Thanks for noticing. I will squash this into the relevant patch.

Also, git_config_copy_section_in_file() and refs_copy_existing_ref()
don't need to be available in public API.
Regards
Sahil Dua
Graduate Software Developer
Booking.com
Connect on LinkedIn
www.sahildua.com


On Thu, Jun 15, 2017 at 3:20 AM, Ramsay Jones
<ramsay@ramsayjones.plus.com> wrote:
>
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>
> Hi Sahil,
>
> If you need to re-roll your 'sd/branch-copy' branch, could you please
> squash this into the relevant patch (commit 37af9c71b6, "config: create
> a function to format section headers", 13-06-2017).
>
> Also, I note that another patch in that branch (commit fd44da469c,
> "branch: add a --copy (-c) option to go with --move (-m)", 13-06-2017),
> adds a couple of external symbols which, currently, don't need to be
> externally visible. Is it intended that git_config_copy_section_in_file()
> and refs_copy_existing_ref() be part of the public API?
>
> Thanks!
>
> ATB,
> Ramsay Jones
>
>  config.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config.c b/config.c
> index 2996e6d56..fbba17483 100644
> --- a/config.c
> +++ b/config.c
> @@ -2173,7 +2173,7 @@ static int write_error(const char *filename)
>         return 4;
>  }
>
> -struct strbuf store_create_section(const char *key)
> +static struct strbuf store_create_section(const char *key)
>  {
>         const char *dot;
>         int i;
> --
> 2.13.0

```

## Sahil Dua, 2017-06-17 22:00

Subject: Re: Subject: [PATCH] config: mark a file-local symbol as static
Message-ID: <CALiud+moeCUV5HibQDK9+cgMUWBQfrAGZ6i0Jcs1SNMjzXkkiQ@mail.gmail.com>
URL: https://gitlist.dev/e/CALiud%2BmoeCUV5HibQDK9%2BcgMUWBQfrAGZ6i0Jcs1SNMjzXkkiQ%40mail.gmail.com
In-Reply-To: <CALiud+nZj4f1=puzXC6grfStg-tQLMGpr-dAdtNwphyvts5KmA@mail.gmail.com>

```
On Sat, Jun 17, 2017 at 11:40 PM, Sahil Dua <sahildua2305@gmail.com> wrote:
> Hi Ramsay,
>
> Thanks for noticing. I will squash this into the relevant patch.
>
> Also, git_config_copy_section_in_file() and refs_copy_existing_ref()
> don't need to be available in public API.
I noticed that git_config_copy_section_in_file() is declared in
cache.h already. I made it this way to keep it consistent with
existing git_config_rename_section_in_file().

Similarly with refs_copy_existing_ref(), it's similar to
refs_rename_ref() (both of these are declared in refs.h).
>
>
> On Thu, Jun 15, 2017 at 3:20 AM, Ramsay Jones
> <ramsay@ramsayjones.plus.com> wrote:
>>
>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
>> ---
>>
>> Hi Sahil,
>>
>> If you need to re-roll your 'sd/branch-copy' branch, could you please
>> squash this into the relevant patch (commit 37af9c71b6, "config: create
>> a function to format section headers", 13-06-2017).
>>
>> Also, I note that another patch in that branch (commit fd44da469c,
>> "branch: add a --copy (-c) option to go with --move (-m)", 13-06-2017),
>> adds a couple of external symbols which, currently, don't need to be
>> externally visible. Is it intended that git_config_copy_section_in_file()
>> and refs_copy_existing_ref() be part of the public API?
>>
>> Thanks!
>>
>> ATB,
>> Ramsay Jones
>>
>>  config.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/config.c b/config.c
>> index 2996e6d56..fbba17483 100644
>> --- a/config.c
>> +++ b/config.c
>> @@ -2173,7 +2173,7 @@ static int write_error(const char *filename)
>>         return 4;
>>  }
>>
>> -struct strbuf store_create_section(const char *key)
>> +static struct strbuf store_create_section(const char *key)
>>  {
>>         const char *dot;
>>         int i;
>> --
>> 2.13.0

```
