feature request: jj ignore #4486
spaceunifyfifty
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The process of adding file system elements to a
.gitignore
both for git and jj could made more ergonomic. It involves manually opening the file in some editor, positioning your caret to the right line, manually typing the element, then saving and closing the file. Or, typing out a slightly janky echo command for appending it to the filewhich only works if your shell is at the root directory, and is too easy too get wrong i.e mispelling the element name, accidentally appending an element that already is in the file, or typing > instead of >> which overwrites the entire file...
Proposal
this would both
target
to the .gitignore filea) regardless of where in the repository you are located when you call it
b) throw an error response if the element already exists in the .gitignore.
c) throw an error message if the element does not exist in the repository.
jj file untrack target
implicitlyThe difference is not massive, but added up over thousands of users doing this thousands of times each year... Reducing 4 steps to 1 step, with all room for error removed, is significant. Why not make things as smooth as possible? Would be one more reason to switch to jj over git. Thanks for your consideration.
Extras
The command could also feature flags like
--recursive
which would add the wildcard global pattern to ignore any
"target"
found at all levels of the repository recursively. The advantage of this isjj ignore "**/target"
), otherwise worry about if their shell will interpret*
unescaped correctly,Beta Was this translation helpful? Give feedback.
All reactions