Skip to content

Conversation

@meowjesty
Copy link
Contributor

I'm new to zig and encountered a deprecated thing being used while going through the reference docs.

(Is it ok to just PR small fixes like this? I looked into the contributing docs and couldn't find anything - or maybe I just missed it).

@mlugg
Copy link
Member

mlugg commented Nov 22, 2025

Is it ok to just PR small fixes like this?

Yes, though I'm afraid we can't guarantee anything will be looked at in a timely manner. (Typo fixes are an exception to this rule; see #21660.)


WRT this PR, IOKG04 is correct that this should use .empty, not .initCapacity. I would suggest applying their diff.

I'd also ask that the local be called gpa rather than allocator; we're generally trying to move towards a convention where allocator variables are named gpa if allocations must be freed and arena if they are freed in bulk separately (i.e. std.heap.ArenaAllocator).

@meowjesty
Copy link
Contributor Author

can't guarantee anything will be looked at in a timely manner

No worries.

I'd also ask that the local be called gpa

Changed it.

Is there some git hygiene thing to follow? Or if it's just a few commits like this it doesn't matter? (will just be squashed when merging?)

^ When checking for this, just noticed that the https://github.com/ziglang/zig/blob/master/.github/CONTRIBUTING.md#editing-source-code that's linked in the main repo doesn't exist? https://github.com/ziglang/zig?tab=readme-ov-file#option-2-using-cmake-and-microsoft-visual-studio

@mlugg
Copy link
Member

mlugg commented Nov 23, 2025

Is there some git hygiene thing to follow?

For small PRs it doesn't matter too much, since we'll just squash on merge if there are multiple commits in a small PR. For bigger PRs, try to keep a clean commit history, particularly if it helps to understand the patch. Ideally, try to make commits fairly atomic (i.e. each commit does one thing and does it fully) and avoid merge commits (prefer rebasing); but we're not strict on it, and ultimately we can always fix up commit history on merge if we need to.

[...] that's linked in the main repo doesn't exist?

Sorry, we just (literally yesterday) reshuffled a bunch of documentation, so there are some dead links at the minute!

@mlugg mlugg enabled auto-merge (squash) November 23, 2025 09:45
@mlugg mlugg merged commit 755a3d9 into ziglang:master Nov 23, 2025
9 checks passed
@meowjesty meowjesty deleted the fix-reference-docs-deprecated-array_list branch November 24, 2025 02:02
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