Skip to content

config: Change default write mode to overwrite #856

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

Closed

Conversation

kamalmarhubi
Copy link
Contributor

No description provided.

@kamalmarhubi
Copy link
Contributor Author

This pull request is to get an idea of what the blockers are for trusting rustfmt to overwrite by default.

@nrc
Copy link
Member

nrc commented Mar 9, 2016

I think this is the way forward, but I don't think we should change from emitting backups to not doing so in one big step. Perhaps we should warn users with a message for a few weeks and then change? Not really sure about the best way to do it - any ideas?

@kamalmarhubi
Copy link
Contributor Author

One thing I've been thinking: introduce a global config similar to ~/.gitconfig, which can have a write-mode setting. Probably write-mode is the only thing that makes sense there so far: I don't like the idea of rustfmt formatting differently with the same project config file. Allowing formatting settings in there would let that happen.

The process could then be:

  1. add facility to lookup global config, and respect any write-mode setting contained therein
  2. start to warn users who do not have a global config with write-mode that it will change soon
  3. switch default write-mode to overwrite

@kamalmarhubi
Copy link
Contributor Author

We could get inspiration from how git changed the push.default setting in 2.0:

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use: 

  git config --global push.default simple

I think they keep the warning until you set the setting though, which we may not want to do.

@nrc
Copy link
Member

nrc commented Mar 13, 2016

re ~/.gitconfig, see also #837

@nrc
Copy link
Member

nrc commented Mar 13, 2016

I like the idea of this approach (following the git push change). I think that to start with the global/per-user config file should be separate from the per-project file, i.e., have completely separate options with different names and the file should have a different name. Then we don't need to worry about whether the per-user or per-project file takes precedence, etc. We can just use it for stuff like this.

@kamalmarhubi
Copy link
Contributor Author

Great! This PR has served its purpose with finding the way forward. I'm closing it and have opened #871.

@kamalmarhubi kamalmarhubi mentioned this pull request Jun 1, 2016
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.

2 participants