# [PATCH] list-objects-filter-options: fix up some sparse warnings

5 messages from 2017-11-20 to 2017-11-22. Participants: Ramsay Jones, Jonathan Nieder, Jeff Hostetler, Stefan Beller.
Thread: https://gitlist.dev/t/47261

## Ramsay Jones, 2017-11-20 23:39

Subject: [PATCH] list-objects-filter-options: fix up some sparse warnings
Message-ID: <b1037774-6ae6-630b-f330-e95b1c3d681d@ramsayjones.plus.com>
URL: https://gitlist.dev/e/b1037774-6ae6-630b-f330-e95b1c3d681d%40ramsayjones.plus.com

```

In particular, sparse complains that the armor_{en,de}code_arg()
functions are 'not declared - should they be static?'. Since the
armor_decode_arg() symbol does not require more than file visibility,
we can simply mark the declaration with static. The armor_encode_arg()
function has no callers, so we simply remove the (unused) definition.

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

Hi Jeff,

If you need to re-roll your 'jh/object-filtering' branch, could you
please squash this (or something like it) into the relevant patch
(commit bf0aedcbe1, "list-objects: filter objects in traverse_commit_list",
16-11-2017).

Thanks!

ATB,
Ramsay Jones

 list-objects-filter-options.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
index 0e4ad70ab..bdbadd5a3 100644
--- a/list-objects-filter-options.c
+++ b/list-objects-filter-options.c
@@ -34,19 +34,7 @@ static int arg_needs_armor(const char *arg)
 	return 0;
 }
 
-void armor_encode_arg(struct strbuf *buf, const char *arg)
-{
-	static const char hex[] = "0123456789abcdef";
-	const unsigned char *p;
-
-	for (p = (const unsigned char *)arg; *p; p++) {
-		unsigned int val = *p;
-		strbuf_addch(buf, hex[val >> 4]);
-		strbuf_addch(buf, hex[val & 0xf]);
-	}
-}
-
-int armor_decode_arg(struct strbuf *buf, const char *arg)
+static int armor_decode_arg(struct strbuf *buf, const char *arg)
 {
 	const char *p;
 
-- 
2.15.0

```

## Jonathan Nieder, 2017-11-21 01:16

Subject: Re: [PATCH] list-objects-filter-options: fix up some sparse warnings
Message-ID: <20171121011634.dw6tdgp2s7lpl2lm@aiede.mtv.corp.google.com>
URL: https://gitlist.dev/e/20171121011634.dw6tdgp2s7lpl2lm%40aiede.mtv.corp.google.com
In-Reply-To: <b1037774-6ae6-630b-f330-e95b1c3d681d@ramsayjones.plus.com>

```
Hi,

Ramsay Jones wrote:

> If you need to re-roll your 'jh/object-filtering' branch, could you
> please squash this (or something like it) into the relevant patch
> (commit bf0aedcbe1, "list-objects: filter objects in traverse_commit_list",
> 16-11-2017).

Micronit: can these messages use the ISO 8601 order 2017-11-16?

That way, the date can be read without confusion regardless of what
locale the reader is in.

Thanks,
Jonathan

```

## Ramsay Jones, 2017-11-21 11:04

Subject: Re: [PATCH] list-objects-filter-options: fix up some sparse warnings
Message-ID: <b5a6ddb1-0971-92d1-4cfb-94366d8f14c3@ramsayjones.plus.com>
URL: https://gitlist.dev/e/b5a6ddb1-0971-92d1-4cfb-94366d8f14c3%40ramsayjones.plus.com
In-Reply-To: <20171121011634.dw6tdgp2s7lpl2lm@aiede.mtv.corp.google.com>

```


On 21/11/17 01:16, Jonathan Nieder wrote:
> Hi,
> 
> Ramsay Jones wrote:
> 
>> If you need to re-roll your 'jh/object-filtering' branch, could you
>> please squash this (or something like it) into the relevant patch
>> (commit bf0aedcbe1, "list-objects: filter objects in traverse_commit_list",
>> 16-11-2017).
> 
> Micronit: can these messages use the ISO 8601 order 2017-11-16?

Hmm, I suppose I could try and train my fingers to use this unnatural
order ... ;-)

[It would probably be easier if I used git to output this for me, rather
than typing it into my email client!]

ATB,
Ramsay Jones


```

## Jeff Hostetler, 2017-11-21 12:36

Subject: Re: [PATCH] list-objects-filter-options: fix up some sparse warnings
Message-ID: <654367f1-bc59-d546-a37d-dcb8f13ca65e@jeffhostetler.com>
URL: https://gitlist.dev/e/654367f1-bc59-d546-a37d-dcb8f13ca65e%40jeffhostetler.com
In-Reply-To: <b1037774-6ae6-630b-f330-e95b1c3d681d@ramsayjones.plus.com>

```


On 11/20/2017 6:39 PM, Ramsay Jones wrote:
> 
> In particular, sparse complains that the armor_{en,de}code_arg()
> functions are 'not declared - should they be static?'. Since the
> armor_decode_arg() symbol does not require more than file visibility,
> we can simply mark the declaration with static. The armor_encode_arg()
> function has no callers, so we simply remove the (unused) definition.
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
> 
> Hi Jeff,
> 
> If you need to re-roll your 'jh/object-filtering' branch, could you
> please squash this (or something like it) into the relevant patch
> (commit bf0aedcbe1, "list-objects: filter objects in traverse_commit_list",
> 16-11-2017).
> 

thanks for the note.
i'm going to remove these functions completely in my next version.
it was decided that we don't need to do encoding/decoding at this level.

Thanks,
Jeff


```

## Stefan Beller, 2017-11-22 00:23

Subject: Re: [PATCH] list-objects-filter-options: fix up some sparse warnings
Message-ID: <CAGZ79kaKWRMDFQLbeRtGmejOD7JD_RCjK5J_HOFqddReT6yOEA@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kaKWRMDFQLbeRtGmejOD7JD_RCjK5J_HOFqddReT6yOEA%40mail.gmail.com
In-Reply-To: <b5a6ddb1-0971-92d1-4cfb-94366d8f14c3@ramsayjones.plus.com>

```
> [It would probably be easier if I used git to output this for me, rather
> than typing it into my email client!]

git config alias.gcs "show --date=short -s --pretty='format:%h ("%s", %ad)'"

will make you the `git gcs` alias that I use to describe commits.

```
