sometimes i wish i can make a commit "intent", like, a pre-commit message saying what im trying to do. i have their super weird experience where once i'm done with my commit, i flush all memory of what i'm doing and have to look at diffs to remember. you'd think i was making large commits, but nope. just me?
Discussion
@ellyxir
Here's quite a hack: if you configure `commit.template` to point to a file, like ”.git/COMMIT_MSG_TEMPLATE`, you can edit that file, then do your changes, and when you then actually type `git commit`, your editor will get prepopulated with what's in that file.
Be aware, however, that you'll need to wipe that file after each commit, or you'll get the exact same message prepopulated for the next commit as well.
I use this as a feature in my cli tool `git-mob`, to prepopulate the commit message with `co-authored-by: ` trailers for the people I'm currently pairing/mobbing with.
@ellyxir
...and now that I'm thinking about this, your use-case (if I understood it correctly) can probably be turned into an actual tool). But it's probably easier to use `jj` instead
@[email protected] I think this is actually how jujutsu is designed to be used github.com/jj-vcs/jj (and it can be used in existing git repositories). This isn't a recommendation, I haven't tried it myself yet, but I found the suggested workflow interesting partly for the reason you state ("have I actually done what I meant to do? What did I mean to do?"), and partly for the next morning issue ("I know I was in the middle of something yesterday...")
@mavnn thanks! ive seen this before, sounds pretty interesting!
@ellyxir I do like the idea! If you’re using a GitHub-ish workflow, perhaps it could be done by opening a (draft) PR right away and writing the intent in the description?
(I also feel like real git gurus well could have some magical commands in store to somehow solve it.)