Skip to content

bookmark: Add git remote origin hint - #10070

Open
barun511 wants to merge 1 commit into
jj-vcs:mainfrom
barun511:add-hint
Open

bookmark: Add git remote origin hint#10070
barun511 wants to merge 1 commit into
jj-vcs:mainfrom
barun511:add-hint

Conversation

@barun511

@barun511 barun511 commented Aug 27, 2026

Copy link
Copy Markdown

When setting up a new repo, I had to look up this command - figured it could just be a jj hint instead!

Before:

image

After:
image

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

@barun511
barun511 requested a review from a team as a code owner August 27, 2026 16:00
@PhilipMetzger

Copy link
Copy Markdown
Contributor

Please move the PR description into the commit message, since the project reviews individual commits.

Adds a hint to the `jj bookmark track` command if the remote specified
was unmatched - so that the user knows how to add the remote.
@barun511

Copy link
Copy Markdown
Author

Thank you! I added a description to the commit message

@yuja

yuja commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

I don't think it's a common mistake to run jj bookmark track without setting up a remote. I'd typically run jj git clone or jj git remote add, then run jj git push -c/--named. There might be a better alternative depending on your workflow.

@slerpyyy

slerpyyy commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

I generally like the idea of making the error messages as helpful as possible, but I think this might lead to some false positives.

  1. The name origin is currently hardcoded in the hint message. If you try to track a bookmark with --remote=upstream and it can't find upstream, it will still tell you to run jj git remote add origin ....
  2. The hint should probably explain what the command does instead of telling users to run it blindly. Something like "To add the missing remote, run ..." would be better.
  3. (optional) It is not clear to me that a missing remote really is the most likely cause for the error. It might be more likely that the remote is just misspelled, in which case this hint is misleading. A check for a remote with a similar name would be a great enhancement to this PR.

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.

4 participants