Skip to content

refactor: enhance git command execution robustness in add_new_entry.py#1028

Open
RinZ27 wants to merge 1 commit intoSunWeb3Sec:mainfrom
RinZ27:fix/robustify-git-discovery
Open

refactor: enhance git command execution robustness in add_new_entry.py#1028
RinZ27 wants to merge 1 commit intoSunWeb3Sec:mainfrom
RinZ27:fix/robustify-git-discovery

Conversation

@RinZ27
Copy link
Copy Markdown

@RinZ27 RinZ27 commented Mar 13, 2026

Updating the GitManager class to avoid relying on shell expansion and shell=True when retrieving Solidity files. Using shell=True with string interpolation is generally a brittle practice, especially when dealing with path specifications. By switching to argument lists (array-based) and implementing manual .sol filtering in Python, we make the internal utility script significantly more stable and predictable across different environments.

Running git ls-files and git diff directly with the target directory ensures that the file discovery logic remains precise. I've also added basic error handling for subprocess calls to prevent the script from crashing if a git command fails. These changes keep the maintainer workflow robust while maintaining the original functionality of the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant