Skip to content
Merged
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
6 changes: 3 additions & 3 deletions blurb/blurb.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def chdir_to_repo_root():
# find the root of the local CPython repo
# note that we can't ask git, because we might
# be in an exported directory tree!

# we intentionally start in a (probably nonexistant) subtree
# the first thing the while loop does is .., basically
path = os.path.abspath("garglemox")
Expand Down Expand Up @@ -1108,14 +1108,14 @@ def print(*a, sep=" "):
git_add_files = []
def flush_git_add_files():
if git_add_files:
subprocess.run(["git", "add", "-f", *git_add_files], stdout=subprocess.PIPE, stderr=subprocess.PIPE).check_returncode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a flag (--verbose CLI option or config) for controlling this? Dumping output out would probably confuse users, who are not familiar with Git.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wouldn’t have helped me. Since the issue seemed to happen just the once, and then not on subsequent runs, I had no opportunity to retry with verbose. The intention here is to avoid swallowing errors.

The behavior on git add is not to output anything so I don’t expect novice users to see anything different in the nominal case.

subprocess.run(["git", "add", "--force", *git_add_files]).check_returncode()
git_add_files.clear()

git_rm_files = []
def flush_git_rm_files():
if git_rm_files:
try:
subprocess.run(["git", "rm", "-f", *git_rm_files], stdout=subprocess.PIPE, stderr=subprocess.PIPE).check_returncode()
subprocess.run(["git", "rm", "--quiet", "--force", *git_rm_files]).check_returncode()
except subprocess.CalledProcessError:
pass

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code below could've run git clean -f ... to wipe out untracked files.

Expand Down