News for hackers. Stuff that matters.
Re:Dura is a background process that watches your Git reposi... by gen220 on Monday January 03, 2022 @04:48PM (#29787431)
Have you considered using `git commit --amend --no-edit` after making your first commit? It simplifies the unwinding step.

This is pretty much my workflow, too. I’ll make some changes, `git commit -m wip`, and then `g can`. When you’re ready to prepare the PR/diff, `reset HEAD^`. Then, a few cycles of `add -p`, `commit -v`.

`commit --amend` and `add --patch` are super powers!

Re:Dura is a background process that watches your Git reposi... by mlyle on Monday January 03, 2022 @04:59PM (#29787551)
If you do this, and find you want to go back to 3-4 commits ago, you need to dig around in the reflog for it.
Re:Dura is a background process that watches your Git reposi... by gen220 on Monday January 03, 2022 @06:17PM (#29788481)
Ah yeah, that's a totally fair critique. Everything in moderation, I suppose. :)

I must avoid those situations by making a new commit when I anticipate wanting to keep the reference to that point in work accessible.

I do dive into `reflog` maybe once or twice a quarter, but as far as I can remember, I only go there as an immediate reaction to tired-brain mistakes.