close
Skip to content

Adds reset (unstage) and checkout of the selected hunk#404

Closed
mokkabonna wants to merge 2 commits into
kemayo:python3from
mokkabonna:checkout-reset-selected-hunk
Closed

Adds reset (unstage) and checkout of the selected hunk#404
mokkabonna wants to merge 2 commits into
kemayo:python3from
mokkabonna:checkout-reset-selected-hunk

Conversation

@mokkabonna
Copy link
Copy Markdown

Just a copy paste of the add hunk command with the -R flag for the checkout hunk command.

The unstage/reset command also adds the --cached parameter.

Should probably be cleaned up to reuse code to get the diff. And share it with the add command. But hey, this works fine.

I'm not really a python developer and someone can probably easily refactor this. But works as is at least.

@mokkabonna mokkabonna force-pushed the checkout-reset-selected-hunk branch from 7b47f9d to a5cbe9e Compare March 13, 2015 18:49
Comment thread reset.py
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'--staged' added

@mokkabonna mokkabonna changed the title Allows to unstage or checkout the selected hunk Adds reset (unstage) and checkout of the selected hunk Mar 13, 2015
@mokkabonna
Copy link
Copy Markdown
Author

Not interested? I myself use this all the time, and with it added to hotkeys it's really fast to undo sections of code.

@mokkabonna mokkabonna closed this May 12, 2022
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.

1 participant