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

Option to rename Cargo.lock #8624

Closed
alexxroche opened this issue Aug 16, 2020 · 2 comments
Closed

Option to rename Cargo.lock #8624

alexxroche opened this issue Aug 16, 2020 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@alexxroche
Copy link

While learning rust I found myself editing Cargo.toml many times. I also noticed that I edited Cargo.lock zero times, (yet the name space collision of the two files is frustrating, and I wonder if its just old people with text editors and an aversion to using mice while writing code, or if there are literally dozens of us.)

I would like a ~/.cargo/config setting that would enable me to rename Cargo.lock to something like .Cargo.lock because it would permit me to edit Cargo.toml with 6 keystrokes rather than 8). "2 keystrokes? Is that all?" said someone that hasn't studied workflow, cognitive load and recursion. I don't need to see the lock file, and everything else that has a lock file finds a nice clean way to tuck it away. (Why isn't it in ~/.cargo/registry/lockfiles/ ? )

Even cargo_lock.toml would be better than the exiting Cargo.lock as $editor C{tab} would open Cargo.toml

I found someone else on a rust discord server that had raised a similar issue (which has been closed but I still face this problem.)

I also noticed a possibly related ticket that I was going to just comment on but realised that it is easier to combine issues into a project than to curate comments into a consistent correction.)

@alexxroche alexxroche added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Aug 16, 2020
@joshtriplett
Copy link
Member

You're not alone; many of us care about keyboard-first ergonomics.

With the benefit of hindsight, I agree that the prefix collision seems unfortunate. At this point, though, I also think the degree of churn and compatibility issues would be high enough to make this a problem to change, not least of which because many repositories have Cargo.lock files checked in.

I can imagine a way to transition this, such as reading Cargo.lock if it exists but writing to a different name if it doesn't. But that seems like an invasive change.

As an alternative, if you use bash, try setting FIGNORE=argo.lock. (Not a typo; FIGNORE doesn't work if set to a complete filename. I've reported that as a bug in bash.) That will cause tab completion to ignore Cargo.lock.

@ehuss
Copy link
Contributor

ehuss commented Sep 18, 2020

I'm going to close, as I agree with @joshtriplett that the amount of churn and inconsistency this would cause is too high. I appreciate that it can be awkward with certain kinds of auto-completion, but I don't think we'll be making a change of this kind.

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

No branches or pull requests

3 participants