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

fix: git-standup find error (#1106) #1110

Merged
merged 1 commit into from
Nov 14, 2023
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
3 changes: 2 additions & 1 deletion bin/git-standup
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ if [[ $in_git_repo != 0 ]]; then
## Set delimiter to newline for the loop
IFS=$'\n'
## Recursively search for git repositories
PROJECT_DIRS=$(find "$INCLUDE_LINKS" . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)
Copy link
Collaborator

@hyperupcall hyperupcall Nov 11, 2023

Choose a reason for hiding this comment

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

Thank you for the catch! A simpler fix would be to remove the quotes from $INCLUDE_LINKS. Either way LGTM

Copy link
Contributor Author

@rm-- rm-- Nov 12, 2023

Choose a reason for hiding this comment

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

I implemented this way because of the shellcheck output:

➜ shellcheck git-extras/bin/git-standup

In git-extras/bin/git-standup line 244:
        PROJECT_DIRS=$(find . -maxdepth $MAXDEPTH -mindepth 0 -name .git)
                                        ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
        PROJECT_DIRS=$(find . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

Copy link
Collaborator

@hyperupcall hyperupcall Nov 12, 2023

Choose a reason for hiding this comment

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

I see - yeah that would be a false positive. Unfortunately some ShellCheck rules seem to have a lot of false positives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change it to your suggestion. It's your decision.
But until now shellcheck like the file. ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use something like #shellcheck disable=SC2086 to disable the spurious warning

Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks!

# shellcheck disable=SC2086
PROJECT_DIRS=$(find $INCLUDE_LINKS . -maxdepth "$MAXDEPTH" -mindepth 0 -name .git)

# Fetch the latest commits, if required
if [ "$FETCH_LAST_COMMIT" = true ]; then
Expand Down
Loading