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

bugfix(?): Write user-provided generated .gitignore content after the API-provided content #232

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

ulucs
Copy link
Contributor

@ulucs ulucs commented Apr 10, 2024

The GitignoreSync task pulls .gitignore data from three different sources: From the user, build process-defined generated_content and API-provided gitignore_io_tokens. This change prints generated_content after gitignore_io_tokens, allowing build setups to overwrite API-provided content (for example, adding !Cargo.lock to generated_content to allow users to commit Cargo lockfiles by overriding the API-provided Rust .gitignore)

@NiklasRosenstein
Copy link
Contributor

The generated content is first because .gitignore applies in order from top to bottom.

# .gitignore
Cargo.lock
!Cargo.lock

Will not ignore Cargo.lock, wheras this will:

# .gitignore
!Cargo.lock
Cargo.lock

@NiklasRosenstein
Copy link
Contributor

(Side note: The uv-installer job is flaky, you can ignore it failing)

@ulucs ulucs force-pushed the ulucs/prioritize-user-gitignore-input branch from 2b09527 to 35ce9b2 Compare April 10, 2024 16:23
@ulucs
Copy link
Contributor Author

ulucs commented Apr 10, 2024

The generated content is first because .gitignore applies in order from top to bottom.

# .gitignore
Cargo.lock
!Cargo.lock

Will not ignore Cargo.lock, wheras this will:

# .gitignore
!Cargo.lock
Cargo.lock

yes, currently the .gitignore sync is set up like this:

<build-process defined lines>
<API-provided lines>
<user-provided lines>

This PR changes it to

<API-provided lines>
<build-process defined lines>
<user-provided lines>

so that the build-process can override the API-provided defaults

@ulucs
Copy link
Contributor Author

ulucs commented Apr 10, 2024

I have edited my initial comment to be clearer on this

@cdbrkfxrpt cdbrkfxrpt merged commit 6fe58a6 into develop Apr 11, 2024
16 checks passed
@cdbrkfxrpt cdbrkfxrpt deleted the ulucs/prioritize-user-gitignore-input branch April 11, 2024 13:35
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