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

Allow editing the staged contents directly #233

Closed
FichteFoll opened this issue Nov 9, 2018 · 5 comments
Closed

Allow editing the staged contents directly #233

FichteFoll opened this issue Nov 9, 2018 · 5 comments
Labels
commit dialog An issue related to the commit dialog enhancement New feature or request

Comments

@FichteFoll
Copy link

FichteFoll commented Nov 9, 2018

Problem description

You can selectively stage lines by selecting them and then using the "Stage Lines" button (or the return key), but occasionally your diffs don't line up so well and you'd need to make manual adjustment to the staged changes. Currently, there is no way within SM to do this, as far as I'm aware.

I'm used to this feature from SmartGit. In detail, SmartGit had a "Index Editor" popup where you'd get a merge view with three panes and you could edit either pane while diffs where generated on the fly. Changes were only saved on demand (i.e. ctrl+s) or in the unsaved changes close modal.

Preferred solution

Allow to edit the staged contents directly, either in the left panel (when using side-by-side diff) or by having a two-way-merge popup like for the conflict solver.

Alternatives

Open the staged file's contents in an external editor (e.g. ST).

@wbond wbond added enhancement New feature or request commit dialog An issue related to the commit dialog labels Jan 2, 2019
@ismell
Copy link

ismell commented Jan 4, 2019

Additionally it would be nice to allow editing the working tree directly from the diff panel.
This would also be nice when rebasing and editing a commit so it would be possible to make trivial changes.

@kakra
Copy link

kakra commented Nov 19, 2019

Being able to edit staged hunks would be a killer feature (because almost no other Git client I tried has this, and it's a must have if you're lazily committing small changes while working on a bigger feature. Often, changes conflict because they cannot go into a commit the way they are now while working on a feature.

The idea of @ismell could come in handy to fix small typos or do last-second-fixes but it should be lower on the priority list.

@heldchen
Copy link

also looking for editing staged hunks directly - this is the single greatest feature of the windows TortoiseGitMerge diff tool that I'm currently dearly missing in linux git clients. TortoiseGitMerge allows some handy diff actions in addition to directly editing the working copy inside the diff view:

  • "Use this text block" to revert working tree changes with original ones
  • "Use both text blocks (this one first)" / "Use both text blocks (this one last)" to prepend/append original lines before changed ones
  • "Use this whole file" to quickly revert all changes

@Narretz
Copy link

Narretz commented Nov 24, 2021

I use hunk editing all the time to keep logs etc. out of commits while I'm developing. The absence of this feature really blocks me from fully moving to SublimeMerge. A naive implementation would also be pretty easy: just do what "git add -p" does when you press "e" - open the configured editor.

@dpjohnst
Copy link
Member

dpjohnst commented Mar 16, 2023

Hi all,

Thank you for your patience while this was implemented. This was added in Sublime Merge 2084 (and will be available in the next stable build too)! You can access this tool via the staged file context menus.

As always, we'd love to hear if you have any thoughts/feedback on this feature!

Kind regards,
- Dylan from Sublime HQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit dialog An issue related to the commit dialog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants