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

Add option to ignore files from being committed #410

Closed
3 tasks
MarcoIeni opened this issue Jan 6, 2023 · 2 comments
Closed
3 tasks

Add option to ignore files from being committed #410

MarcoIeni opened this issue Jan 6, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers priority:medium We care about this

Comments

@MarcoIeni
Copy link
Owner

Motivations

The conversation started here.

Context: Release-plz runs git add . when running the release-pr command.
So before running, it checks if the git repository is clean.

We might want to ignore some files for some reasons:

  • these files are produced by the CI and we don't want them to be committed in the release-pr.
  • users might not want to commit some files changed by release-plz (like changelogs, Cargo.lock or Cargo.toml files) of some crate. Even though for this use-case we might have specific configurations for each crate.

Solution

  • When checking if the repository is clean, ignore these files.
  • After running git add ., remove these files from the git staging area.
  • When release-plz detects that the repository is not clean, suggest to add these files to the ignored files list.
@MarcoIeni MarcoIeni added enhancement New feature or request good first issue Good for newcomers labels Jan 6, 2023
@MarcoIeni
Copy link
Owner Author

MarcoIeni commented Apr 1, 2023

Instead of adding a custom flag, we could run cargo package --list and rely on cargo to only consider the relevant files. Docs here: https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields

When running the diff algorithm, we should only consider these files.

@MarcoIeni MarcoIeni added the priority:medium We care about this label Apr 5, 2023
@MarcoIeni
Copy link
Owner Author

Close in favor of #721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers priority:medium We care about this
Projects
None yet
Development

No branches or pull requests

1 participant