You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 file
echo "target/" >> .gitignore
which 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
jj ignore target
this would both
append target to the .gitignore file
a) 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.
run jj file untrack target implicitly
The 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
jj ignore target --recursive
which would add the wildcard global pattern to ignore any "target" found at all levels of the repository recursively. The advantage of this is
users don't have to remember or reason about glob syntax. No room for error. They can speak at a high-level, what they want, rather than worry about the lower-level implementation for how they can get it.
users don't have to wrap their target name within quotation marks (i.e jj ignore "**/target"), otherwise worry about if their shell will interpret * unescaped correctly,
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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