Hacker News new | ask | show | jobs
by fmoralesc 4260 days ago
I tried to integrate git into this with per-file repos once, but I never really used it much: https://github.com/fmoralesc/vim-autogit This commits on writes.

> I think commiting should be done for a more meaningful unit of work than a single edit, something logically 'complete' akin to a transaction.

What do you think would be a good set of criteria for what should count as a meaningful unit of work?

2 comments

> What do you think would be a good set of criteria for what should count as a meaningful unit of work?

I'd consider a meaningful unit of work to be a bug fixed, or feature implemented, at least to the extent that you have a runnable version of the code again (even if you intend to do further work to implement it better e.g. replacing hard-coding). I'd consider changes short of this as not worth commiting, as this would not be a good starting point for further work (I know it's cheap to branch with Git etc., but it just feels untidy to leave something so part-done).

Is the motivation for commit-on-write to get a kind of persistent history for undo/redo? That is an interesting idea.
Yes. The commits are recorded in an independent repo, so you can have both a per-file history of changes and a global history.