-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stack diff): Compute stack diff correctly (#159)
This was originally gonna just be running the diff in interactive mode to enable the pager but I figured out the way were computing the diff wasn't quite right. I describe the complexities in comments in `stack_diff.go`. # Test plan I have branches like ``` * 2023-06-05-one-b 2d1f535 (2023-06-05-one) | | * 2023-06-05-two-b 001f28f (HEAD -> 2023-06-05-two) |/ | * 2023-06-05-one-a aba0167 ``` Before this change, running `av stack diff` on the second branch includes removing the changes from the second commit of branch one. ```diff $ av stack diff diff --git a/2023-06-05 b/2023-06-05 index aee8822..6dc6612 100644 --- a/2023-06-05 +++ b/2023-06-05 @@ -1,2 +1,2 @@ Mon Jun 5 15:02:42 PDT 2023 -Mon Jun 5 15:05:50 PDT 2023 +Mon Jun 5 15:05:04 PDT 2023 ``` After this change, it shows just the diff from the second branch commits and also a warning that the branch is not up to date. ```diff $ av stack diff diff --git a/2023-06-05 b/2023-06-05 index 5982c55..6dc6612 100644 --- a/2023-06-05 +++ b/2023-06-05 @@ -1 +1,2 @@ Mon Jun 5 15:02:42 PDT 2023 +Mon Jun 5 15:05:04 PDT 2023 WARNING: Branch 2023-06-05-two is not up to date with parent branch 2023-06-05-one. Run av stack sync to synchronize the branch. ```
- Loading branch information
Showing
4 changed files
with
103 additions
and
31 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
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