From: David Turner Date: Tue, 13 Oct 2015 21:18:16 GMT Subject: Re: [PATCH v3 02/44] refs: make repack_without_refs and is_branch public Message-ID: <1444771096.18742.3.camel@twopensource.com> In-Reply-To: <561CB188.2090508@alum.mit.edu> On Tue, 2015-10-13 at 09:23 +0200, Michael Haggerty wrote: > On 10/13/2015 04:39 AM, Michael Haggerty wrote: > > On 10/12/2015 11:51 PM, David Turner wrote: > >> is_branch was already non-static, but this patch declares it in the > >> header. > >> > >> Signed-off-by: Ronnie Sahlberg > >> Signed-off-by: David Turner > >> --- > >> [...] > > > > It seems odd that repack_without_refs() should be made public (and > > ultimately end up in refs.h) given that it intrinsically only has to do > > with file-based references. But I will read on... > > I think the reason you needed to do this was because you wanted to move > delete_refs() to the common code. It is true that delete_ref() can be > moved to the common code. And most of the code in delete_refs() is just > a loop calling delete_ref(). But delete_refs() also does the very > files-specific optimization of calling repack_without_refs() before the > loop. *That* call shouldn't be in the common code. > > So my suggestion is that you write a common_delete_refs() function that > only includes the loop over delete_ref(), and a files_delete_refs() > function that is basically > > { > result = repack_without_refs(refnames, &err); > if (result) { > ...report error... > return result; > } > return common_delete_refs(...); > } OK, I can do that. That will have to be part of the backends work, so I'll exclude it from the refs-backend-pre-vtable patch set.