-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit_builder: reset author timestamp on discardable commits
It's common to create empty working-copy commits while using jj, and currently the author timestamp for a commit is only set when it is first created. If you create an empty commit, then don't work on a repo for a few days, and then start working on a new feature without abandoning the working-copy commit, the author timestamp will remain as the time the commit was created rather than being updated to the time that work began or finished. This commit changes the behavior so that discardable commits (empty commits with no description) by the current user have their author timestamps reset when they are rewritten, meaning that the author timestamp will become finalized whenever a commit is given a description or becomes non-empty.
- Loading branch information
Showing
36 changed files
with
1,330 additions
and
1,236 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ fn test_builtin_alias_trunk_matches_main() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 main 45a3aa29 | ||
◉ xtvrqkyv [email protected] 2001-02-03 08:05:08 main d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -64,7 +64,7 @@ fn test_builtin_alias_trunk_matches_master() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 master 45a3aa29 | ||
◉ xtvrqkyv [email protected] 2001-02-03 08:05:08 master d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -76,7 +76,7 @@ fn test_builtin_alias_trunk_matches_trunk() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 trunk 45a3aa29 | ||
◉ xtvrqkyv [email protected] 2001-02-03 08:05:08 trunk d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -91,7 +91,7 @@ fn test_builtin_alias_trunk_matches_exactly_one_commit() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 main 45a3aa29 | ||
◉ xtvrqkyv [email protected] 2001-02-03 08:05:08 main d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
@@ -107,7 +107,7 @@ fn test_builtin_alias_trunk_override_alias() { | |
|
||
let stdout = test_env.jj_cmd_success(&workspace_root, &["log", "-r", "trunk()"]); | ||
insta::assert_snapshot!(stdout, @r###" | ||
◉ lzmmnrxq [email protected] 2001-02-03 08:05:08 override-trunk 45a3aa29 | ||
◉ xtvrqkyv [email protected] 2001-02-03 08:05:08 override-trunk d13ecdbd | ||
│ (empty) description 1 | ||
~ | ||
"###); | ||
|
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
Oops, something went wrong.