-
Notifications
You must be signed in to change notification settings - Fork 319
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
config: introduce default at = @
revset alias
#4432
Open
thoughtpolice
wants to merge
1
commit into
main
Choose a base branch
from
aseipp/push-xpxxovltuqmy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symbol aliases overrides tags and branches, so builtin aliases have to be all functions. And
at()
wouldn't be easy to type.Maybe add doc example instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's unfortunately a pretty big hole in the side of the ship, so to speak. A doc example is at least in order though.
I also feel like this is something we should should have tests for i.e. iff there exists any keys in
[revset-aliases]
in any of the builtin configs, and they are not functions, then panic — since I wouldn't have thought of this without your suggestion. So maybe I should fix that, too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more verbose way to specify a branch/tag specifically? I feel like
at
will not be a common name for those, so as long as there’s an override it might be okay.Also, it should maybe say “PowerShell” rather than “Windows” here, as… technically you can use it on other OSes. Technically. (And there was some confusion about
cmd.exe
not requiring it on the Discord.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"at"
ortags(exact:at)
works, but less special case is better. It would be weird iftrunk
was a builtin alias and not pointing to thetrunk
branch. Theat
alias looks similar.I also think that, to work around PowerShell, it's better to find another symbol (e.g.
.
) to replace@
, instead of adding a builtin alias which only PowerShell users would practically use.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason I didn't pick
.
for the working copy was that it seemed like it would be confusing to former Mercurial users (.
is the parent of the working copy there). Also, the@
symbol works well in the graph log output. I'm not sure.
would work as well there. It might be hard to notice, and it might be hard to realize the correspondence with the revset symbol. Were you thinking of shipping.
as an alias or to eventually have it replace@
?Shipping
at
by default on Windows might be okay if we think only (a subset of) Windows users would use it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do people think about Yuya's proposal to simply document the alias? Seems fine to at least start with that and see how many reports we get after that?
Btw, if the
@
symbol is annoying for PowerShell users, then our use of it in remote bookmarks and workspace identifiers will also be a problem, although a much less frequent one. I suppose one possible alternative syntax that works particularly well for remote bookmarks isorigin/main
, but I'm not sure I like/
for the working copy and/other
for the working copy in workspaceother
as much.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s okay in those contexts because it isn’t the first character in a token.
main@origin
isn’t a problem because PowerShell doesn’t interpret that as the start of an array since it’s after a word character.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
@other
(which refers to the working-copy in workspaceother
) is still a problem then.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, so
default@
,..@
, etc. work. The workspace id syntax is<id>@
, btw.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually already document it, sort of, in https://martinvonz.github.io/jj/latest/windows/#typing-in-powershell. That recommends
HEAD
, which is not as good asat
IMO.Should we make rename it and make it more prominent? I think so. It'd make sense to explain it in the main config doc and then link to it again from the Windows doc. Update: Even on non-Windows, it's nice to not have to reach for the Shift key sometimes.
Separately (and not blocking the more obvious improvements), should we explain the
"at"
syntax for a branch/tag next to where we describe revset aliases?Separately again, I still wonder about the larger issue. While we reduce the problem of overlaps with branch names if we don't define
at
ourselves, it'd be nice to have a solution that also works for users who configured it themselves (and maybe forget). But we can ponder and/or discuss this question long after we fix the easy-to-fix things.