Skip to content

refactor(delete-merged-branches): rm -n1 from xargs, fmt pipes#1233

Open
Rudxain wants to merge 5 commits intotj:mainfrom
Rudxain:refactor-delete-merged
Open

refactor(delete-merged-branches): rm -n1 from xargs, fmt pipes#1233
Rudxain wants to merge 5 commits intotj:mainfrom
Rudxain:refactor-delete-merged

Conversation

@Rudxain
Copy link
Copy Markdown
Contributor

@Rudxain Rudxain commented Feb 24, 2026

@Rudxain Rudxain changed the title refactor(delete-merged-branches): xargs -r to avoid if refactor(delete-merged-branches): xargs -r to avoid if, and etc... Feb 24, 2026
@spacewander
Copy link
Copy Markdown
Collaborator

Thank you for the PR!

However, xargs -r is a GNU extension and is not available on all platforms (e.g. older macOS, BSD, Solaris). While modern macOS xargs might support it as a no-op compatibility flag, strictly conforming POSIX systems or older BSDs will fail.

Since git-extras aims for broad portability, relying on xargs -r might be risky.

The previous if [ -n "$branches" ] block, while verbose, is fully portable.

If you want to avoid the if block, another portable way (though slightly more complex to read) used in bin/git-sed is to check for -r support dynamically, but that seems overkill here.

Removing -n 1 is a good improvement for performance!

Comment thread bin/git-delete-merged-branches Outdated
@Rudxain Rudxain changed the title refactor(delete-merged-branches): xargs -r to avoid if, and etc... refactor(delete-merged-branches): rm -n1 from xargs, fmt pipes Mar 3, 2026
@Rudxain Rudxain requested a review from spacewander April 30, 2026 00:04
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.

2 participants