Created
January 29, 2015 15:48
-
-
Save Pictor13/696ccbff671393e2c912 to your computer and use it in GitHub Desktop.
"Compare to Stash..." custom comparision for Sublimerge
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
# Add the custom comparision "Compare to Stash..." to SublimeMerge plugin | |
# This allows to compare the current file with the version contained in a stash. | |
# Custom Comparisions.sublime-settings -- User | |
{ | |
"custom_comparisons_user": [ | |
{ | |
"name": "Compare to Stash...", | |
"requires": "git", | |
"steps": [ | |
{ | |
"quick_panel": { | |
"name": "get_stash", | |
"source": { | |
"execute": { | |
"command": "{git} stash list", | |
"directory": "{sublimerge:current_file_dir}" | |
}, | |
"item": { | |
"regexp": "^(stash\\@\\{.+\\})(?:\\:\\s+)(.+)$", | |
"caption": ["@1: @2", "{sublimerge:current_file_name} in @1"], | |
"value": "@1" | |
}, | |
"empty_message": "There are no stashes" | |
} | |
} | |
}, | |
{ | |
"define": { | |
"output_file": "{sublimerge:temp_dir}/{sublimerge:current_file|basename}@stash" | |
} | |
}, | |
{ | |
"compare": { | |
"execute": { | |
"command": "{git} show {get_stash}:\"./{sublimerge:current_file_name}\" > \"{output_file}\"", | |
"directory": "{sublimerge:current_file_dir}" | |
}, | |
"left": { | |
"title": "{sublimerge:current_file|basename}@{get_stash}", | |
"file": "{output_file}", | |
"temporary": true | |
}, | |
"right": { | |
"file": "{sublimerge:current_file}", | |
"temporary": false | |
} | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment