Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging: Use subprocess instead of os.popen for change log creation #3469

Merged
merged 27 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
66806c5
Addresses warning from Bandit - Injection attack risk in util file fo…
kpolchow Feb 26, 2024
a1dc3b9
fixed issues w/ changed variable names, consistent w/ before. all out…
kpolchow Mar 11, 2024
e3776ec
Update utils/gitlog2changelog.py
kpolchow Mar 16, 2024
d440e08
added a new line to comply with linux convention
naidneelttil Mar 17, 2024
e006aaa
formatted the code with black, a python formatter
naidneelttil Mar 19, 2024
6c501bc
remove import os as it is no longer used
naidneelttil Mar 19, 2024
3e5f906
tried to optionally add rev_range, on an experiemental branch
naidneelttil Mar 20, 2024
1dea42b
tried to optionally append by adding it to the list
naidneelttil Mar 20, 2024
374ed2a
changed the command from subprocess popen to suprocess run and attemp…
naidneelttil Mar 20, 2024
3efe1f6
formatted the document according the black (the python formatter)
naidneelttil Mar 20, 2024
b6f213a
added the full path for git
naidneelttil Mar 20, 2024
d5dbd95
added missing forward slash
naidneelttil Mar 20, 2024
d67e07d
attempt to optionally add rev_range
naidneelttil Mar 20, 2024
21b3fcb
format with black (python formatter)
naidneelttil Mar 20, 2024
395d1c4
appended rev_range as a formatted string
naidneelttil Mar 20, 2024
a02626c
test commit, if the args are swallowed if empty, how does that create…
naidneelttil Mar 20, 2024
38cbe73
changing back to popen for testing
naidneelttil Mar 20, 2024
b6018a3
changed popen spelling
naidneelttil Mar 20, 2024
50c8397
attempt to optionally add argument to git command by reversing order…
naidneelttil Mar 20, 2024
2c29f68
removed the format string, and just appended rev_range if applicable
naidneelttil Mar 20, 2024
f7aea51
revert back to a semi working version (util-injection)
naidneelttil Mar 20, 2024
9d8cadc
optionally added rev_range if arguments are given
naidneelttil Mar 20, 2024
68680ad
try with shell = true
naidneelttil Mar 20, 2024
7278bff
try encoding with utf8 to avoid getting back bytes
naidneelttil Mar 20, 2024
d129ff2
add the empty new line at the end to keep with linux convention
naidneelttil Mar 20, 2024
8307e7e
Merge pull request #24 from ncsu-csc472-spring2024/releasebranch_popen
naidneelttil Mar 20, 2024
f22bf29
fixed formatting warning by black python formatter
naidneelttil Mar 20, 2024
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
18 changes: 16 additions & 2 deletions utils/gitlog2changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@
# Distributed under the terms of the GNU General Public License v2 or later

import re
import os
from textwrap import TextWrapper
import sys
import subprocess

rev_range = ""


# Define the git command and its arguments as a list
git_command = [
"git",
"log",
"--summary",
"--stat",
"--no-merges",
"--date=short",
]

if len(sys.argv) > 1:
base = sys.argv[1]
rev_range = "%s..HEAD" % base
git_command.append(rev_range)

# Execute git log with the desired command line options.
fin = os.popen("git log --summary --stat --no-merges --date=short %s" % rev_range, "r")
wenzeslaus marked this conversation as resolved.
Show resolved Hide resolved
echoix marked this conversation as resolved.
Show resolved Hide resolved
process = subprocess.Popen(git_command, stdout=subprocess.PIPE, encoding="utf8")
fin = process.stdout

# Create a ChangeLog file in the current directory.
fout = open("ChangeLog", "w")

Expand Down
Loading