-
Notifications
You must be signed in to change notification settings - Fork 312
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
cli: workspace update-stale: set description on recovery commit #4738
Open
martinvonz
wants to merge
1
commit into
main
Choose a base branch
from
push-pukplruotqxy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -689,14 +689,14 @@ fn test_workspaces_current_op_discarded_by_other() { | |
"###); | ||
|
||
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["workspace", "update-stale"]); | ||
insta::assert_snapshot!(stderr, @r#" | ||
insta::assert_snapshot!(stderr, @r###" | ||
Failed to read working copy's current operation; attempting recovery. Error message from read attempt: Object 8d4abed655badb70b1bab62aa87136619dbc3c8015a8ce8dfb7abfeca4e2f36c713d8f84e070a0613907a6cee7e1cc05323fe1205a319b93fe978f11a060c33c of type operation not found | ||
Created and checked out recovery commit 62f70695e3b0 | ||
"#); | ||
Created and checked out recovery commit 863c247c4ee8 | ||
"###); | ||
insta::assert_snapshot!(stdout, @""); | ||
|
||
insta::assert_snapshot!(get_log_output(&test_env, &main_path), @r###" | ||
○ b0b400439a82 secondary@ | ||
○ b2aa3385aa5b secondary@ | ||
○ 96b31dafdc41 | ||
│ @ 6c051bd1ccd5 default@ | ||
├─╯ | ||
|
@@ -718,7 +718,7 @@ fn test_workspaces_current_op_discarded_by_other() { | |
A added | ||
D deleted | ||
M modified | ||
Working copy : kmkuslsw b0b40043 (no description set) | ||
Working copy : kmkuslsw b2aa3385 recovery commit from `jj workspace update-stale` | ||
Parent commit: rzvqmyuk 96b31daf (empty) (no description set) | ||
"###); | ||
// The modified file should have the same contents it had before (not reset to | ||
|
@@ -730,10 +730,10 @@ fn test_workspaces_current_op_discarded_by_other() { | |
let (stdout, stderr) = test_env.jj_cmd_ok(&secondary_path, &["evolog"]); | ||
insta::assert_snapshot!(stderr, @""); | ||
insta::assert_snapshot!(stdout, @r###" | ||
@ kmkuslsw [email protected] 2001-02-03 08:05:18 secondary@ b0b40043 | ||
│ (no description set) | ||
○ kmkuslsw hidden [email protected] 2001-02-03 08:05:18 62f70695 | ||
(empty) (no description set) | ||
@ kmkuslsw [email protected] 2001-02-03 08:05:18 secondary@ b2aa3385 | ||
│ recovery commit from `jj workspace update-stale` | ||
○ kmkuslsw hidden [email protected] 2001-02-03 08:05:18 863c247c | ||
(empty) recovery commit from `jj workspace update-stale` | ||
"###); | ||
} | ||
|
||
|
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.
(Optional)
The first line is a bit inconspicuous and doesn't make it clear that the commit is machine-generated. Perhaps add
JJ AUTO-RECOVERY:
before it? Then, people will know that something strange happened, and what to search for and ask about.We could also try it as is and see how many of these commits get generated and how in conspicuous they are.
BTW, I'm not sure everyone agrees, but I generally like the idea of having
jj
useJJ SOMETHING:
as a marker for some text that is special tojj
, extending theJJ:
syntax we use in description editor (I don't mean to do this religiously, but it makes sense to me here).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 don't have a strong feeling, but it would be nice if the description looked unusual. User might push the recovery commit by mistake if it looked like a normal commit.
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.
Maybe we should prefix it with
JJ:
and use that private commits feature to ensure that commits starting withJJ:
don’t get pushed by default.