Sublime Forum

Feature request: specify base for git diff markers

#1

The new Sublime Text git integration is great! The performance is almost worth switching from GitGutter, but I’m missing one important feature: being able to specify the base branch/commit that I’m working from.

When working on a change, it’s useful to be able to find and navigate all the changes — even if I’ve already added some of them into commits already.

As a workaround, I can soft reset to the base branch/commit and leave all my changes in the index. However, this loses the ability to group changes into multiple commits, and risks blowing away changes without being able to retrieve them from the commit history or reflog.

Even cooler would be the ability to distinguish between base branch/commit/staged/unstaged, but collapsing the last three is sufficiently useful for me.

Thanks for any consideration!
»Lucas

0 Likes

#2

You’ve probably already noticed this, but note that the git_diff_target can be used to determine what the diff markers are based on:

    // This setting determines whether tracked Git files should be diffed
    // against the index or HEAD.
    // Valid values are "index" or "head"
    "git_diff_target": "index",
0 Likes

#3

You’ve probably already noticed this, but note that the git_diff_target can be used to determine what the diff markers are based on:

Yeah, this is useful in some situations! :smiley:

An additional value of upstream would also make sense, although that would usually include “additional changes since the last time I pushed this branch (e.g. to a GitHub PR)” rather than “all changes on this branch (e.g. the changes included in a GitHub PR)”.

0 Likes

#4

I really like the integration with Sublime Merge, but I agree this feature needs to be integrated directly into Sublime Text. Having to constantly switch between the two apps just to confirm what all of my changes look like together is clunky.
As someone who prefers a workflow with many incremental commits that get squashed together before merging, it’s been super useful to use a plugin like GitGutter to track my changes since the actual commit I’m going to squash everything down on top of (usually the upstream branch).

0 Likes