Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [Licenses Inventory] Update to v4.0.6 ([#160](https://github.com/Orange-OpenSource/floss-toolbox/issues/160))

### Fixed

- [Diver] Missing execution permission for extract-emails-from-history.sh ([#171](https://github.com/Orange-OpenSource/floss-toolbox/issues/171))
- [Diver] Failed to process repositories at path with whitespaces ([#172](https://github.com/Orange-OpenSource/floss-toolbox/issues/172))

## [2.20.0](https://github.com/Orange-OpenSource/floss-toolbox/compare/2.20.0..2.19.0) - 2024-04-04

### Added
Expand Down
Empty file modified toolbox/diver/extract-emails-from-history.sh
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions toolbox/diver/generate-contributors-file.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Authors: See CONTRIBUTORS.txt
# Software description: A toolbox of scripts to help work of forges admins and open source referents

# Version.............: 1.0.0
# Version.............: 1.0.1
# Since...............: 03/04/2023
# Description.........: Using the Git history, generates a CONTRIBUTORS.md file

Expand Down Expand Up @@ -56,7 +56,7 @@
print(f"✏️ Creating folder '{TEMP_FOLDER}' with internal stuff in target")
os.makedirs(TEMP_FOLDER_FULL_PATH, exist_ok=True)

# Check if Git repository is empty (check if there are at least 1 commit in the logs)
# Check if Git repository is empty (check if there is at least 1 commit in the logs)
command_result_output = subprocess.check_output("git log --oneline -1 > /dev/null 2>&1 | wc -l", shell=True)
command_result = int(command_result_output.decode().strip())
if command_result == "0":
Expand All @@ -67,15 +67,15 @@

# Dump Git logs
print("✏️ Dumping Git logs")
# Create the log file, go to targetn and run the git command
# Format the output to have first name, last name (upercased) and email, sorted alphabetically ascending
# Deal also the case where we only have one value between first and last name
# Create the log file, go to target, and run the git command.
# Format the output to have first name, last name (upercased) and email, sorted ascending alphabetically.
# Deal also the case where we only have one value between first and last name.
git_log_command = """
touch {log_file} && cd {target} && git log --all --format="%aN <%aE>" | sort | uniq | awk '{{if ($2 !~ /@/) {{print $1, toupper($2), $3}} else {{print $1, $2, $3}}}}' | sort -k2 > {log_file}
touch "{log_file}" && cd "{target}" && git log --all --format="%aN <%aE>" | sort | uniq | awk '{{if ($2 !~ /@/) {{print $1, toupper($2), $3}} else {{print $1, $2, $3}}}}' | sort -k2 > "{log_file}"
""".format(target=target, log_file=GIT_LOG_TEMP_FILE_PATH)
os.system(git_log_command)

contributors_count_output = subprocess.check_output("cat {log_file} | wc -l".format(log_file=GIT_LOG_TEMP_FILE_PATH), shell=True)
contributors_count_output = subprocess.check_output("cat '{log_file}' | wc -l".format(log_file=GIT_LOG_TEMP_FILE_PATH), shell=True)
contributors_count = int(contributors_count_output.decode().strip())
print(f"👉 Found maybe {contributors_count} contributors")

Expand Down