naggie / dstask

Git powered terminal-based todo/note manager -- markdown note page per task. Single binary!
https://calbryant.uk/blog/dstask-a-taskwarrior-alternative/
MIT License
793 stars 47 forks source link

Task operations should amend similar unpushed changes #157

Closed ljmf00 closed 2 years ago

ljmf00 commented 2 years ago

Since unpushed changes don't affect the sync process, a single operation made twice shouldn't pollute the Git history and instead amend them.

This should also consider changes distant from each other, if possible.

naggie commented 2 years ago

Could you give an example?

ljmf00 commented 2 years ago

Could you give an example?

For example, these were all unpushed changes 355fa41 .. a256f3e:

image

These three commits, are the same operation, but done more than once (e.g. fixing some typo on the notes). Would be good to squash/amend these similar operations.

Also, additionally, it is also possible to amend operations that are not continuous in history, without breaking the git merge strategy.

For example, cef2ff7 and 355fa41:

image I have four operations distant from a similar one. All these operations were made without pushing. This can be, at least, an option for users that don't want such polluted git history.

Dieterbe commented 2 years ago

When using git to manage source code, you'd want a "clean, readable" history. When using git in dstask, we don't use it in the same way. We only use it as a mechanism for sync, basically.

I can see how what you ask for may make sense in your particular example, and worth pursuing if it's easily doable. But I can easily imagine other users who would not appreciate that individual changes of the same task get squashed together.

naggie commented 2 years ago

I don't think it's worth adding a bit of complexity for the marginal benefit here. Thanks for the idea though.