Skip to content

Suggestion: add ability to edit hunk #1275

@OliverJAsh

Description

@OliverJAsh

Is your feature request related to a problem? Please describe.
Lazygit makes it really easy to select specific lines to be staged, however sometimes I need more flexibility.

For example, I have these unstaged changes:

 export const demo = Demo.Collection.fromComponent(UserStatsSubRoute)({
-  name: 'UserStats',
-  children: [StatsGraphDemo, MilestonesDemos],
+  name: displayName,
+  children: [StatsGraphDemo, UsesDemo, MilestonesDemos],
 });

I only want to add the change to name, not to children.

If I select the name line addition/deletion, I end up with this staged diff:

 export const demo = Demo.Collection.fromComponent(UserStatsSubRoute)({
-  name: 'UserStats',
   children: [StatsGraphDemo, MilestonesDemos],
+  name: displayName,
 });

What I wanted:

 export const demo = Demo.Collection.fromComponent(UserStatsSubRoute)({
-  name: 'UserStats',
+  name: displayName,
   children: [StatsGraphDemo, MilestonesDemos],
 });

Describe the solution you'd like
The ability to "edit hunk" similar to what is available when you run git add --interactive and use the e command.

This would make it easy for me to stage the changes because I would be able to delete and re-order the order of the addition/deletions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions