From: Derrick Stolee Date: Tue, 28 Aug 2018 21:39:32 GMT Subject: Re: [PATCH] commit-reach: correct accidental #include of C file Message-ID: <6ae7f8fd-9be5-992e-e5a4-35254c263280@gmail.com> In-Reply-To: <20180828213657.GA74296@aiede.svl.corp.google.com> On 8/28/2018 5:36 PM, Jonathan Nieder wrote: > Without this change, the build breaks with clang: For some reason, it didn't fail with GCC for me, but this is an obviously correct change to make. Thanks! > libgit/ref-filter.pic.o: multiple definition of 'filter_refs' > libgit/commit-reach.pic.o: previous definition here > > Signed-off-by: Jonathan Nieder > --- > Jonathan Nieder wrote: >> Derrick Stolee wrote: >>> --- a/commit-reach.c >>> +++ b/commit-reach.c >>> @@ -1,8 +1,10 @@ >>> #include "cache.h" >>> #include "commit.h" >>> +#include "commit-graph.h" >>> #include "decorate.h" >>> #include "prio-queue.h" >>> #include "tree.h" >>> +#include "ref-filter.c" >> Did you mean "ref-filter.h"? >> >> This broke the build here. Is there some check that we can use to >> prevent it happening again? I don't think we ever intentionally >> #include a .c file. > Here's what I'm applying locally. > > Thanks, > Jonathan > > commit-reach.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/commit-reach.c b/commit-reach.c > index c996524032..86715c103c 100644 > --- a/commit-reach.c > +++ b/commit-reach.c > @@ -4,7 +4,7 @@ > #include "decorate.h" > #include "prio-queue.h" > #include "tree.h" > -#include "ref-filter.c" > +#include "ref-filter.h" > #include "revision.h" > #include "tag.h" > #include "commit-reach.h"