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

Differentiate between staged and unstaged changes #136

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

jisaacks
Copy link
Owner

No description provided.

If a line as staged and unstaged changes it will be colors with markup.changed.git_gutter.staged_unstaged
It will also use a new icon
* Use the --staged flag of git diff to get staged changes
* Keep an adjustment map to adjust staged change line numbers

The diff returned by *git diff --staged* does NOT consider unstaged changes.
This means that we get the line numbers for where the staged changes would
be at if there were no unstaged changes. So when there are unstaged changes
the line numbers for where the staged changes are get shifted. As we process
the unstaged changes we keep track of an adjustment map (how many lines were
added/removed for each line - at what line number) and apply this to the staged
changes to put the line numbers in the correct place.
Creates handler if not present.
Also should fix the key error (when handler isn't present) in #138
@jisaacks jisaacks mentioned this pull request Feb 2, 2014
@Raynos
Copy link

Raynos commented Feb 6, 2014

Would love to test this.

Is there an easy way to install Git Gutter Staged from sublime text package control ?

@jisaacks
Copy link
Owner Author

jisaacks commented Feb 6, 2014

No there is not, but you can install it very easily with git. If you need
help with that I can walk you through it. :)

On Thursday, February 6, 2014, Raynos (Jake Verbaten) <
[email protected]> wrote:

Would love to test this.

Is there an easy way to install Git Gutter Staged from sublime text
package control ?

Reply to this email directly or view it on GitHubhttps://github.com//pull/136#issuecomment-34384726
.

@maliayas
Copy link

maliayas commented May 8, 2014

Will this be finished?

@jisaacks
Copy link
Owner Author

jisaacks commented May 8, 2014

@maliayas I am working on some infrastructure that will allow users to easily test pre releases. Once that is setup up, I am going to be focusing on the protected regions feature. #113 and #161

After that release I will probably shift my focus to this branch.

@maliayas
Copy link

maliayas commented May 8, 2014

I understand. Thank you very much.

@mokkabonna
Copy link

This would be great, I just made a reset(ustage)/checkout of selected hunk in the git package. kemayo/sublime-text-git#404

With the gutter having no difference between the two it is a bit hard knowing which one to use.

@BarbzYHOOL
Copy link

BarbzYHOOL commented Sep 19, 2018

This would be very useful

If it gets updated I might try the PR, just warn me

@TerminalFi
Copy link

This still being looked at?

@deathaxe
Copy link
Collaborator

I havn't done much about GitGutter at all as most of its features are part of core ST right now. I thought about a more "lightweight" variant to handle stuff, which is not yet part of the core, but hesitated due to some incompatibilities it would imply.

I played around with solutions about displaying staged/unstaged changes but the required changes are quite huge and I ran into several issues which were not so easy to handle. Abandoned those work in the end.

I personally got used to use Sublime Merge for more sophisticated comparisons, so havn't the need to push that feature into GitGutter. Don't even know how to properly mark it in the gutter as we default to ST's default minidiff if it is available.

@deathaxe deathaxe force-pushed the master branch 2 times, most recently from f34b421 to ee362a7 Compare December 31, 2022 19:47
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.

7 participants