If I need to track time, I will use a time tracker.
Sometimes I will work on one thing, notice something different in a file I am working on, and will fix it, then make a partial commit.
Sometimes I work on a Vue component which needs to fetch some data. I will design the component, mock the data, then add a vuex action to call an API and save the data to a vuex store, commit the changes to vuex (because the store can work without the component, but the component will not work without data, and I try to avoid committing test data whenever possible), and finally commit the ones to the component later.
Find a way that makes you a more efficient coder, and don't set arbitrary rules for yourself. Ensuring that I work on things in a very specific order rather than when I need them would not make me more efficient. Committing incomplete or broken code would not make me more efficient. (Occasionally, that can't be helped; I may make a broken commit and push it just so I can resume work on another machine).
That said, I like doing things my way. If you find another method more suitable for your workflow, that's great.
Thanks for sharing! This very much looks like my workflow and was part of why I asked this question. I sometimes go from one thing to another because of my process that when all completed builds out one thing, like a new feature for example. It would be really hard to commit things and work in a way to allow for this. Also, like others have noted there are tools in Git, like rebasing, that will change this metadata and make it no longer reflect reality and looking at the timestamps wouldn't matter then.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.