Skip to content

yes: remove cfg & move ownership of buffer to fn exec#12095

Open
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:yes-own
Open

yes: remove cfg & move ownership of buffer to fn exec#12095
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:yes-own

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Apr 30, 2026

buffer is never used after fn exec. So move ownership.
Required for #11458 to extract len() before growing it.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/retry is no longer failing!
Congrats! The gnu test tests/timeout/timeout-group is no longer failing!
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.

@RenjiSann
Copy link
Copy Markdown
Collaborator

Sorry I thought you wanted to merge #11458 before

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 30, 2026

No problem. Easy to rebase.

@oech3 oech3 changed the title yes: refactor: move ownership of buffer to fn exec yes: remove cfg & move ownership of buffer to fn exec Apr 30, 2026
@oech3 oech3 force-pushed the yes-own branch 2 times, most recently from a8ca52c to f706e97 Compare April 30, 2026 13:16
@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 30, 2026

prepare_buffer is not a good name for me. How about renaming it to grow_buffer to clarify that buffer is modified?

@oech3 oech3 marked this pull request as ready for review April 30, 2026 13:49
@xtqqczze
Copy link
Copy Markdown
Contributor

prepare_buffer is not a good name for me. How about renaming it to grow_buffer to clarify that buffer is modified?

"grow" doesn't suggest to me the buffer is written, how about repeat_from_within?

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 30, 2026

How about let buffer = repeated_buffer(buffer) for shorter name? I don't see any reason to avoid moving ownership again.

@RenjiSann
Copy link
Copy Markdown
Collaborator

Let's make it clear before we make it short.
I'd go with repeat_content_to_capacity, wdyt ?

@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 30, 2026

It sometimes does not exactly fit to capacity. But OK.

@RenjiSann
Copy link
Copy Markdown
Collaborator

It sometimes does not exactly fit to capacity. But OK.

Yes, and that's a detail you get upon read the docstring, which is fine.
Let's not be too verbose either 😁

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