Skip to content
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

Ordered hashes, to make better diffs #84

Merged
merged 2 commits into from
Oct 19, 2018
Merged

Ordered hashes, to make better diffs #84

merged 2 commits into from
Oct 19, 2018

Conversation

domanchi
Copy link
Contributor

Current Issue

@@ -994,17 +994,17 @@
         "type": "Hex High Entropy String"
       },
       {
-        "hashed_secret": "b927c80e00a783f0169fa2a4a115ee9ed7011d9b",
+        "hashed_secret": "e9fb1204aaac5061bf3c08c820f1cfaeb9c83aae",
         "line_number": 10,
         "type": "Hex High Entropy String"
       },
       {
-        "hashed_secret": "e9fb1204aaac5061bf3c08c820f1cfaeb9c83aae",
+        "hashed_secret": "88261181847473b4d9933c8e6ec7068a839213ed",
         "line_number": 10,
         "type": "Hex High Entropy String"
       },
       {
-        "hashed_secret": "88261181847473b4d9933c8e6ec7068a839213ed",
+        "hashed_secret": "b927c80e00a783f0169fa2a4a115ee9ed7011d9b",
         "line_number": 10,
         "type": "Hex High Entropy String"
       },

As you can see, the above hashed_secrets kinda played musical chairs, making diffs harder to read, and larger than they really need to be.

Solution

Order the secrets first by line number, then by hashed_secret. This way, it should have a deterministic order.

Copy link
Collaborator

@KevinHock KevinHock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@domanchi domanchi merged commit 42a81ac into master Oct 19, 2018
@domanchi domanchi deleted the nicer-diffs branch October 19, 2018 18:00
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.

None yet

2 participants