Skip to content

Commit 04d5572

Browse files
authored
[#171] [#172] Permission and path with whitespaces fixes (#173)
* fix: failed to process Git repository at path with whitespaces (#172) Closes #172 Signed-off-by: Pierre-Yves Lapersonne <[email protected]> * fix: execution permission to Shell script missing (#171) Closes #171 Signed-off-by: Pierre-Yves Lapersonne <[email protected]> --------- Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 2eb20d5 commit 04d5572

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

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

19+
### Fixed
20+
21+
- [Diver] Missing execution permission for extract-emails-from-history.sh ([#171](https://github.com/Orange-OpenSource/floss-toolbox/issues/171))
22+
- [Diver] Failed to process repositories at path with whitespaces ([#172](https://github.com/Orange-OpenSource/floss-toolbox/issues/172))
23+
1924
## [2.20.0](https://github.com/Orange-OpenSource/floss-toolbox/compare/2.20.0..2.19.0) - 2024-04-04
2025

2126
### Added

toolbox/diver/extract-emails-from-history.sh

100644100755
File mode changed.

toolbox/diver/generate-contributors-file.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Authors: See CONTRIBUTORS.txt
1111
# Software description: A toolbox of scripts to help work of forges admins and open source referents
1212

13-
# Version.............: 1.0.0
13+
# Version.............: 1.0.1
1414
# Since...............: 03/04/2023
1515
# Description.........: Using the Git history, generates a CONTRIBUTORS.md file
1616

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

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

6868
# Dump Git logs
6969
print("✏️ Dumping Git logs")
70-
# Create the log file, go to targetn and run the git command
71-
# Format the output to have first name, last name (upercased) and email, sorted alphabetically ascending
72-
# Deal also the case where we only have one value between first and last name
70+
# Create the log file, go to target, and run the git command.
71+
# Format the output to have first name, last name (upercased) and email, sorted ascending alphabetically.
72+
# Deal also the case where we only have one value between first and last name.
7373
git_log_command = """
74-
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}
74+
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}"
7575
""".format(target=target, log_file=GIT_LOG_TEMP_FILE_PATH)
7676
os.system(git_log_command)
7777

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

0 commit comments

Comments
 (0)