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

How to not insert email into Cargo.toml by default when doing cargo init? #4892

Closed
Boscop opened this issue Jan 3, 2018 · 2 comments · Fixed by #6802
Closed

How to not insert email into Cargo.toml by default when doing cargo init? #4892

Boscop opened this issue Jan 3, 2018 · 2 comments · Fixed by #6802
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@Boscop
Copy link

Boscop commented Jan 3, 2018

There should be an option for that.
When I do

[cargo-new]
email = ""

it writes authors = ["NAME <>"] but it shouldn't append the " <>".

@alexcrichton
Copy link
Member

You can see the various methods Cargo uses, and if they're all unset the email shouldn't show up. We could also add a feature where empty emails don't have <> characters.

@Boscop
Copy link
Author

Boscop commented Jan 6, 2018

I have a git email configured but I don't want it to be inserted into Cargo.toml, that's why I want to be able to override it with that [cargo-new] setting.
(Btw, none of those 4 env vars is set for me (Win 8.1). Only the global git config email is set.)

@alexcrichton alexcrichton added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 6, 2018
bors added a commit that referenced this issue Mar 31, 2019
new/init: Don't include email if it is empty.

For `cargo new` or `cargo init`, if the email address is empty, don't include an empty `<>` in the `authors` field in `Cargo.toml`. This can be useful if you want to include an email address in the git config, but you don't want it in new manifest files.

Closes #4892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants