Open hrehfeld opened 3 years ago
Hey! Thanks for these suggestions! Does this mean the current situation isn't to your liking? If git-auto-commit-mode
is enabled for all files in a repository every time you make a change you would get a new commit, so I'm not sure which files would be left to commit with it.
Can you elaborate on your situation perhaps?
So, I took some notes in the last weeks. I notice the following use-cases/problems relating to single file commits:
a.org
to b.org
, and save all org-mode buffers. Now I have two commits, one which removes the headline in a.org
and one that adds it to b.org
, which feels a lot like inconsistent history/information lost. On code this would be a broken commit.a.org
, which creates an entry in .org-id-locations
. I save a.org
, but only a.org
is committed, not .org-id-locations
.a.org
. I save the file, a.org
is commited, but I have to manually add the picture file and commit, leaving me with a half-broken commit.So, there are two problems:
Thank you, that helps a lot! Those are excellent points. For the first problem you mention I don't think there is currently anything that can help this, I'll have a look at implementing this when I have some time.
For the second problem you mention, I think this is what gac-debounce-interval
should help with. You should be able to set this to the number of seconds that you want to wait before committing. But I think this only works for individual files at the moment.
I see the following options here:
(setq git-auto-commit-mode-context 'file)
(setq git-auto-commit-mode-context 'subtree)
(setq git-auto-commit-mode-context 'repository)
gtd.org
would add(setq git-auto-commit-mode-context '("gtd.archive.org" "inbox.org")
And then also
(setq git-auto-commit-mode-staged-only t)