You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I had to do it with vanilla git, I would do git add -p, then git diff --staged > patch.diff, then git rebase -i %(commit), then edit the TODO to edit this commit (this I don’t know how to do programmatically), then git apply patch.diff and finally git rebase --continue.
I wonder how it could be emulated in tig, specifically this rebase interactive+edit todo in one script.
Best,
The text was updated successfully, but these errors were encountered:
MartyLake
changed the title
Do we have something like "custom patch" in tig:
Do we have something like "custom patch" in tig?
Apr 18, 2023
Tig doesn't have dedicated support for this feature yet; I think it would be a nice feature.
In the diff view, pressing u could add the selected hunk to a per-commit index. It should be possible to add this special index to an earlier or later commit, or create a separate commit for it.
For the time being, I suggest using git-revise, another 3rd party tool. I sometimes use these bindings to split commits:
Hey, I stumbled upon a demonstration of lazygit, most of it I could already do with tig.
There was this concept called "custom patch"
https://github.com/jesseduffield/lazygit/wiki/Directly-Changing-Code-Stored-In-Commits#lazygit-solution , where one has this temporary diff space and shortcut command to apply the patch to a former commit.
If I had to do it with vanilla git, I would do
git add -p
, thengit diff --staged > patch.diff
, thengit rebase -i %(commit)
, then edit the TODO to edit this commit (this I don’t know how to do programmatically), thengit apply patch.diff
and finallygit rebase --continue
.I wonder how it could be emulated in tig, specifically this rebase interactive+edit todo in one script.
Best,
The text was updated successfully, but these errors were encountered: