[v2,1/3] Makefile: define THIRD_PARTY_SOURCES
diff mbox series

Message ID 3878cb2598c677d139c8734b61772d0cdcfdb935.1568309119.git.liu.denton@gmail.com
State New
Headers show
Series
  • Makefile: run coccicheck on all non-upstream sources
Related show

Commit Message

Denton Liu Sept. 12, 2019, 5:28 p.m. UTC
After looking through the source files in compat/ and investigating the
files' content and/or its Git history, I've determined the list of files
that were copied from a third-party source. Place the names of these
files into the THIRD_PARTY_SOURCES variable in the Makefile.

In addition, add the sha1collisiondetection/ and sha1dc/ sources as well
since they are also imported from a third-party source.

In a future commit, this variable will be used to determine which files
are excluded when running the "coccicheck" target.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Makefile | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Junio C Hamano Sept. 12, 2019, 9:42 p.m. UTC | #1
Denton Liu <liu.denton@gmail.com> writes:

> After looking through the source files in compat/ and investigating the
> files' content and/or its Git history, I've determined the list of files
> that were copied from a third-party source. Place the names of these
> files into the THIRD_PARTY_SOURCES variable in the Makefile.

Please make sure readers won't get fooled into thinking these are
filenames.  They are meant to be used in $(filter-out) as patterns
to match the names of third-party source files.

Also, the paragraph before that talks about "I did this", but
claiming credit is much less important than why we are doing this in
the first place, which you forgot to say (perhaps because you were
too deeply into the task and the motivation was too obvious to you).

So, if I were doing this patch, I'd justify the whole thing as such:

	Some files in our codebase are borrowed from other projects,
	and minimally updated to suit our own needs.  We'd sometimes
	need to tell our own sources and these third-party sources
	apart for management purposes (e.g. we may want to be less
	strict about coding style and other issues on third-party
	files).

	Define the $(MAKE) variable THIRD_PARTY_SOURCES that can be
	used to match names of third-party sources.


>  
> +THIRD_PARTY_SOURCES += compat/inet_ntop.c
> +THIRD_PARTY_SOURCES += compat/inet_pton.c
> +THIRD_PARTY_SOURCES += compat/obstack.%
> +THIRD_PARTY_SOURCES += compat/nedmalloc/%
> +THIRD_PARTY_SOURCES += compat/poll/%
> +THIRD_PARTY_SOURCES += compat/regex/%
> +THIRD_PARTY_SOURCES += sha1collisiondetection/%
> +THIRD_PARTY_SOURCES += sha1dc/%

Before this block, please explain that this is meant to be a list of
patterns suitable for $(filter-out) and friends in a comment.

Thanks.

Patch
diff mbox series

diff --git a/Makefile b/Makefile
index ad71ae1219..b88b42d7ed 100644
--- a/Makefile
+++ b/Makefile
@@ -598,6 +598,7 @@  SCRIPT_SH =
 SCRIPT_LIB =
 TEST_BUILTINS_OBJS =
 TEST_PROGRAMS_NEED_X =
+THIRD_PARTY_SOURCES =
 
 # Having this variable in your environment would break pipelines because
 # you cause "cd" to echo its destination to stdout.  It can also take
@@ -1146,6 +1147,15 @@  BUILTIN_OBJS += builtin/verify-tag.o
 BUILTIN_OBJS += builtin/worktree.o
 BUILTIN_OBJS += builtin/write-tree.o
 
+THIRD_PARTY_SOURCES += compat/inet_ntop.c
+THIRD_PARTY_SOURCES += compat/inet_pton.c
+THIRD_PARTY_SOURCES += compat/obstack.%
+THIRD_PARTY_SOURCES += compat/nedmalloc/%
+THIRD_PARTY_SOURCES += compat/poll/%
+THIRD_PARTY_SOURCES += compat/regex/%
+THIRD_PARTY_SOURCES += sha1collisiondetection/%
+THIRD_PARTY_SOURCES += sha1dc/%
+
 GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
 EXTLIBS =