dstask icon indicating copy to clipboard operation
dstask copied to clipboard

Single commit for bulk commands

Open naggie opened this issue 6 years ago • 6 comments

Currently dstask undo results in the last commit being undone. This is OK for most commands but some commands can result in multiple commits so undo is unintuitive in this case, requiring manual git history manipulation.

dstask should probably record git tags or remember checkpoint refs.

naggie avatar Jan 14 '20 08:01 naggie

some commands can result in multiple commits

what are some examples of this? do we need this?

Dieterbe avatar Nov 16 '20 06:11 Dieterbe

Yes, for example if you reference several issues by ID on a done, modify, start, stop command. Also, with a confirmation, modify can change all tasks in the current context.

naggie avatar Nov 16 '20 08:11 naggie

seems like both those examples could be recorded as a single commit. per the commonly used "one commit per logical change" git mantra, it seems that they should do this, actually.

Dieterbe avatar Nov 16 '20 16:11 Dieterbe

I had considered, even implemented that. However, I decided I liked the ability to keep the commits atomic per task which affords a nice summary message per commit. I did start a git-revert range implementation in a branch but never finished it due to some complications.

I wonder, though, given I never really review the commit history anyway, for these bulk commits we could summarize the actions in the commit message body by listing the the changed tasks as we would normally do in a commit message. It sure would simplify things....

eg:

modified 32 tasks


Change: +home +fridge
* Buy some bananas
* Buy some apples

...

naggie avatar Nov 16 '20 18:11 naggie

In fact I think that is a better solution. Thanks for the nudge @dontlaugh

naggie avatar Sep 22 '21 19:09 naggie

It might require a bit of refactoring though, but it's a simpler solution.

naggie avatar Sep 22 '21 19:09 naggie