diff options
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | Makefile.am | 5 | ||||
-rwxr-xr-x | tools/generate_authors.pl | 6 |
3 files changed, 10 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 08d805480b..ac866575b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2582,15 +2582,15 @@ add_custom_target(test-sh ) set_target_properties(test-sh PROPERTIES FOLDER "Tests") -#Generate list of AUTHORS (Name + E-Mail) sort by name if (GIT_EXECUTABLE) - ADD_CUSTOM_TARGET( + # Update AUTHORS file with entries from git shortlog + add_custom_target( gen-authors - COMMAND ${GIT_EXECUTABLE} --no-pager shortlog -se HEAD > ${CMAKE_SOURCE_DIR}/AUTHORS.git - COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/generate_authors.pl ${CMAKE_SOURCE_DIR}/AUTHORS.src ${CMAKE_SOURCE_DIR}/AUTHORS.git > ${CMAKE_SOURCE_DIR}/AUTHORS + COMMAND ${PERL_EXECUTABLE} tools/generate_authors.pl AUTHORS.src > AUTHORS + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) else (GIT_EXECUTABLE) - ADD_CUSTOM_TARGET( gen-authors COMMAND ${CMAKE_COMMAND} -E echo "Git not found." ) + add_custom_target( gen-authors COMMAND ${CMAKE_COMMAND} -E echo "Git not found." ) endif (GIT_EXECUTABLE) set_target_properties(gen-authors PROPERTIES FOLDER "Docs") diff --git a/Makefile.am b/Makefile.am index 90eb45abec..c0d6f24395 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1071,7 +1071,6 @@ if HAVE_DOXYGEN zip -rq wsar_html.zip wsar_html endif +# Update AUTHORS file with entries from git shortlog gen-authors: -#Generate list of AUTHORS (Name + E-Mail) sort by number of commit - git --no-pager shortlog -se HEAD > $(top_srcdir)/AUTHORS.git - $(PERL) $(top_srcdir)/tools/generate_authors.pl $(top_srcdir)/AUTHORS.src $(top_srcdir)/AUTHORS.git > $(top_srcdir)/AUTHORS + cd $(top_srcdir) && $(PERL) tools/generate_authors.pl AUTHORS.src > AUTHORS diff --git a/tools/generate_authors.pl b/tools/generate_authors.pl index 187abf670f..21c05cbf02 100755 --- a/tools/generate_authors.pl +++ b/tools/generate_authors.pl @@ -4,7 +4,7 @@ # Generate the AUTHORS file combining existing AUTHORS file with # git commit log. # -# Usage: generate_authors.pl <original AUTHORS file> <output of git shortlog> +# Usage: generate_authors.pl AUTHORS.src # # Copyright 2016 Michael Mann (see AUTHORS file) @@ -189,8 +189,8 @@ close $author_fh; print $git_log_text; -# XXX open "git shortlog ... |" instead? -open( my $git_author_fh, '<', $ARGV[1] ) or die "Can't open $ARGV[1]: $!"; +open( my $git_author_fh, 'git --no-pager shortlog -se HEAD|') + or die "Can't execute git shortlog: $!"; while ( my $git_line = decode('UTF-8', <$git_author_fh>) ) { chomp $git_line; |