Commits on Sep 18, 2017
  1. Cut 1.7.5

    deathaxe committed Sep 18, 2017
  2. Fix: Hide "Show Diff Popup" in main menu if not supported

    deathaxe committed Sep 18, 2017
    This commit provides required changes to hide the diff popup command from main menu, if the prerequisites for popups are not meat.
    The change includes to always publish the `GitGutterDiffPopupCommand` class to Sublime Text and add the `is_visible()` method. As this class was the last remaining in popup commands in order to be created on demand only, it is now moved to `modules/`. Now all command classes are provided by this one and only module.
  3. Fix: Compare against… panels don't show immediately. (#446)

    deathaxe committed Sep 18, 2017
    Executing one of the "Compare against ..." commands from command pallet may cause the quick panel which lists the available targets not to be displayed without further key press or mouse click under some circumstances.
    Investigations revealed the `sublime.set_timeout_async()` not to execute the requested function after a certain amount of delay. All depending functions are not executed.
    Until now all git calls have been delayed by 10ms to give ST's plugin_host a chance to trigger other plugin's timers between two calls.
Commits on Sep 15, 2017
Commits on Sep 14, 2017
  1. Internal: Refactor built and release system

    deathaxe committed Sep 13, 2017
    GitGutter's built and release system relies on ruby, make and bash scripts.
    1. They are not available by nature on every operating system.
    2. Sublime Text's python engine can do the same thing without external dependencies.
    3. The release message files exist twice in the repository.
    The goals of this commit are to ...
    1. Built & publish releases directly from ST3.
    2. Store release messages in "messages" folder once as all the other packages do.
    3. Keep the opportunity to make releases from the shell if desired.
    With this commit, releasing a new version of GitGutter requires the following steps:
    1. Set-Up the GitHub access token (needed once)
       - Call "Preferences: GitGutter Settings" from command pallet
       - Add a key "github_token": "..." to the user file.
    2. Create a proper message file in the "messages" folder.
       - The name is the version being used to release.
       - The first line of the file contains the version as heading for ST.
       - The global message is not required (it is added by step 3)
    3. Call "GitGutter: Build Release" from command pallet
       This will create a "Cut 1.x.x" commit and tag locally.
    4. Call "GitGutter: Publish Release" from command pallet
       This will ...
       - push the latest commit of master branch
       - push the release tag
       - create a release with the release message from the most recent messages/1.x.x.txt
    The "Release" commands are visible only, if the "github_token" is set up.
    The also provides a CLI to run it from shell as follows:
      ./release build
      ./release publish --token <thetoken>
    The makefile was modified as well.
    All release-related files are added to the .gitattributes to prevent them from being deployed in ordinary sublime-package files.
Commits on Sep 13, 2017
  1. Internal: Cleanup imports of test_promise

    deathaxe committed Sep 13, 2017
    Avoid from ... import
  2. Internal: Update json_test to ignore comment indention

    deathaxe committed Sep 13, 2017
    This commit
    1. equalizes the usage of quotes for text constants.
    2. applies an update from facelessuser to ignore comment indentions.
Commits on Sep 12, 2017
  1. Internal: Tidy up .gitignore

    deathaxe committed Sep 12, 2017
    Most entries in the .gitignore seem to originate in ordinary python package development. They don't need to be considered in a sublime text package.
    On the other hand some cache files/folders might need to be ignored, such as mypy cache next to some others.
  2. Internal: Satisfy unit tests of Sublime JSON resources

    deathaxe committed Sep 12, 2017
    The recently added JSON unit tests revealed some smaller issues with some of the resource files, which are fixed in this commit.
    - indent with 4 spaces
    - ensure newline at eof
  3. Internal: Add unit tests for Sublime JSON resources.

    deathaxe committed Sep 12, 2017
    This commit adds a unit test to help prevent issues with malformed JSON resources.
    Much thanks for the amazing goes to Isaac Muse <>
  4. Enhancement: Add LSP diagnostics to protected regions

    deathaxe committed Sep 12, 2017
    The LSP package provides so called diagnostics. These are info/warning/error messages from a language-server - linter messages normally. GitGutter now handles them the same way SublimeLinter messages are.
  5. Fix: Revert change doesn't work in ST2

    deathaxe committed Sep 12, 2017
    The text command "revert_change" was originally designed to work with diff popup only, which is not available for ST2. It uses a command "git_gutter_replace_text" to perform text replacement, which is required as there is no valid edit token available in popups.
    The implementation of "git_gutter_replace_text" is moved up to to make it available in ST2, too.
  6. Fix: Toggle GitGutter via main menu works with second click only.

    deathaxe committed Sep 12, 2017
    The main menu entry to enable/disable GitGutter uses the core command "toggle_setting", which works for settings placed within the "Preferences.sublime-settings" file only. It is used because of the nice check mark it adds to the menu to indicate GitGutter is enabled.
    Therefore the toggled setting "git_gutter_enabled" needs to be published to preferences with its default value `true` in order to make the command work properly.
    This is achieved by adding a `Preferences.sublime-settings` file with this setting.
    As GitGutter always looks for a setting within the Preferences and makes use of GitGutter.sublime-settings only as a fallback, the "enable" entry in `GitGutter.sublime-settings` file will never be queried again and can be removed.
    We loose the ability to globally disable GitGutter via "Preferences: GitGutter Settings" command. But as disabling it globally still works via Preferences.sublime-settings and may not make too much sense at all, the step back should not be too big.
    Note: The gutter marks may be removed on the next on_activate event, which seems not be sent after menu item click.
  7. Enhancement: Add support for line/point arguments to git_gutter_rever…

    deathaxe committed Sep 12, 2017
    This commit extends the text command "git_gutter_revert_change" to support arguments to explicitly revert changes of a certain line or text point. This may be used by macros or external plugins.
       view.run_command("git_gutter_revert_change", {"line": 10})
       view.run_command("git_gutter_revert_change", {"point": 3022})
       view.run_command("git_gutter", {"action": "revert_change", "line": 10})
       view.run_command("git_gutter", {"action": "revert_change", "point": 3022})
    It takes an optional argument
      - "line", which is the zero based line number of the hunk to copy or
      - "point", which is the text position of the cursor.
    If none of them is provided the line under the first cursor is used.
  8. Enhancement: Add a command with keybinding to copy content from commit

    deathaxe committed Sep 11, 2017
    With GitGutter's diff popup a user can copy the committed content of a hunk to clipboard.
    This commit adds the text command "git_gutter_copy_from_commit" to publish this functionality as
       view.run_command("git_gutter_copy_from_commit", {"line": 10})
       view.run_command("git_gutter_copy_from_commit", {"point": 3022})
       view.run_command("git_gutter", {"action": "copy_from_commit", "line": 10})
       view.run_command("git_gutter", {"action": "copy_from_commit", "point": 3022})
    It takes an optional argument
      - "line", which is the zero based line number of the hunk to copy or
      - "point", which is the text position of the cursor.
    If none of them is provided the line under the first cursor is used.
    Also adds:
    - main menu entry
    - command pallet entry
    - key bindings (Ctrl+Shift+c)
    NOTE: The operation does not work with multiple cursors at the moment.
Commits on Sep 10, 2017
  1. Internal: Refactor and sort imports

    deathaxe committed Sep 10, 2017
    It is always a mess to rebase or merge branches, which add or remove imports resulting in merge conflicts due to the way multiple imports are arranged.
    To solve this issue and make merging work like a charm without conflicts, only one class/module/package is imported per line.
    This commit does not provide any functional changes.
  2. Fix: Compare against Origin hint in Preferences

    deathaxe committed Sep 10, 2017
    Copy the modified comment of "Compare against Origin" from GitGutter.sublime-settings to Preferences-sublime-settings-hints to display the new @{upstream} target in project specific settings tooltips (of PackageDev) as well.
Commits on Sep 9, 2017
  1. Enhancement: Flatten the Compare against Main Menu

    deathaxe committed Sep 9, 2017
    GitGutter provides the following menu items:
    - Main Menu -> View -> GitGutter -> Compare Against -> HEAD
    - Main Menu -> View -> GitGutter -> Compare Against -> branch
    - ...
    As the "Compare Against" menu item is almost the only one within "GitGutter" it makes reaching the desired ones unnecessarily complicated.
    Therefore this commit moves all "Compare against" menu items up by one level in order to make them accessible more easily.
    Furthermore it adds an entry to display the diff popup just for consistency.
  2. Enhancement: Add Revert Change to Edit Main Menu

    deathaxe committed Sep 9, 2017
    This commit intends to enhance consistency of commands availability. All of them should at least be available via
       - key bindings
       - command pallet
       - main menu (for legacy users)
    This commit therefore adds the git_gutter_revert_change command to the main menu with the hopefully clear and meaningful caption "Revert Change to Commit". To keep consistent, the caption is modified in the command pallet and README, too.
  3. Enhancement: Toggle GitGutter via Main Menu and Command Pallet

    deathaxe committed Sep 9, 2017
    Add a simple "toggle_setting" command to enable or disable GitGutter for the current view without entering the console and calling `view.settings().set("git_gutter_enable", False/True)`
  4. README: Update Goto/Revert Change

    deathaxe committed Sep 9, 2017
    This commit provides the following changes:
    1. The description of the following commands is moved just right after the diff popup paragraph to make them to be associated more obvious.
      - GitGutter: Goto Previous Change
      - GitGutter: Goto Next Change
      - GitGutter: Revert Change
    2. The "Jump" is replaced by "Goto" to reflect the association of the commands with the "Goto" main menu.
    3. The "Goto" commands are added to the command pallet.
  5. README: Update Compare against paragraph

    deathaxe committed Sep 9, 2017
    This commit adds the list of default key bindings to the paragraph as they are available for the other commands already.
  6. Internal: Reduce duplications in command objects

    deathaxe committed Sep 9, 2017
    This commit removes duplicate methods `run` which call `self.view.run_command('git_gutter', ...)` to forward commands to the main GitGutterCommand object of a view.
    The run() method is moved to the GitGutterBaseCommand class to be implemented once, only. Each command class stores an 'ACTION' class attribute to identify the action to forward to GitGutterCommand.
  7. Fix: Compare against Origin (Issue #371)

    deathaxe committed Aug 31, 2017
    Closes: #371
    This commit changes the "Compare against Origin" function to store `<branch_name>@{upstream}` as compare target instead of `<branch_name>` which might not be useful in all use cases.
    This modification enables a user to compare against the upstream revision of each currently checked out branch.
    The command name an the title are not modified for backward compatibility reasons.
    If the local branch doesn't have a tracked remote branch, each file is displayed as `inserted`.
Commits on Aug 31, 2017
  1. Internal: Remove unused import

    deathaxe committed Aug 31, 2017
Commits on Aug 27, 2017
  1. Enhancement: Add command with keybinding to revert changes

    deathaxe committed Aug 27, 2017
    With GitGutter's diff popup a user can revert a changed hunk to the state of the compared commit.
    This commit moves the code to perform the revert operation into a dedicated module and adds it to the internal command chain:
    1. Add the with the implementation moved from popup.factory module
    2. Add "revert_change" to command map in the main GitGutterCommand class.
       provides: `view.run_command("git_gutter", {"action": "revert_change"}`
    3. Add TextCommand "git_gutter_revert_change" meant for external use.
       provides: `view.run_command("git_gutter_revert_change"}`
    4. Add an entry to the Default.sublime-commands
    5. Add Ctrl+Shift+Alt+Z key binding.
    6. Add a short note to the README.
    NOTE: The revert operation does not work with multiple cursors at the moment.
Commits on Aug 16, 2017
  1. Cut 1.7.4

    deathaxe committed Aug 16, 2017
Commits on Aug 11, 2017
  1. Internal: Log the reason for GitGutter to be disabled

    deathaxe committed Aug 11, 2017
    In order to have a chance to determine, why GitGutter keeps quite for certain files, the reason is printed to console, if
      "debug": true
    is set. The state itself is handled as integer for performance reasons. The text message is created only, if GitGutter has something to tell. The descriptions are organized using a dict rather than a tuple to provide a clear and obvious association between the state id and the message being printed.
Commits on Aug 10, 2017
  1. Fix: Gutter icons are not displayed in Sublime Text 2

    deathaxe committed Aug 10, 2017
    The issue was introduced with commit 9e5ab88 which intends to reduce gutter icon jumping
    The view change counter is used to check whether to update the regions or not. If this counter is not available the gutter icons are never updated as the related function returns true in that case.
    This commit changes the behavior of the function to return False if the change counter is not available.
  2. Internal: Cache global settings as function attribute

    deathaxe committed Aug 10, 2017
    In order to avoid the usage of global variables the global settings object, which represents the GitGutter.sublime-settings is cached as attribute of the get() function.
  3. README: Add troubleshooting for GitGutter keeping disabled

    deathaxe committed Aug 10, 2017
    Add the list of situations when GitGutter keeps quite to let users know about them. The question arouse several times in the past.
Commits on Aug 2, 2017
  1. Cut 1.7.3

    deathaxe committed Aug 2, 2017
Commits on Jul 31, 2017
  1. Fix: Reduce gutter icon jumping while editing text

    deathaxe committed Jul 30, 2017
    As evaluation of changes and updating the gutter icons is handled asynchronously, the view might change in the meanwhile, rendering the evaluation result invalid or at least inaccurate. As the result lines can't be translated to correct regions anymore. Therefore added regions may jump up or down to the next line.
    To reduce this effect two changes are made:
    1. initial evaluation delay is increased to 200ms
    2. updating regions (gutter icons) is skipped if the view change counter has changed during evaluation