Skip to content

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

Merged
spacewander merged 7 commits into
tj:mainfrom
Rudxain:refactor-delete-merged
May 18, 2026
Merged

refactor(delete-merged-branches): rm -n1 from xargs#1233
spacewander merged 7 commits into
tj: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
Copy link
Copy Markdown
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

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

Thanks for this change, I like the removal of -n. Could you remove the other changes and only keep the removal of -n part?

With theses changes, it'll look good to me.

Comment thread bin/git-delete-merged-branches Outdated
Comment thread bin/git-delete-merged-branches Outdated
Copy link
Copy Markdown
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@spacewander spacewander merged commit 99207ee into tj:main May 18, 2026
6 checks passed
@spacewander
Copy link
Copy Markdown
Collaborator

Merged. Thank you!

@Rudxain Rudxain changed the title refactor(delete-merged-branches): rm -n1 from xargs, fmt pipes refactor(delete-merged-branches): rm -n1 from xargs May 18, 2026
@Rudxain Rudxain deleted the refactor-delete-merged branch May 18, 2026 13:39
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.

3 participants