cms icon indicating copy to clipboard operation
cms copied to clipboard

Add a "save comment" that can be passed to git commit

Open RickCogley opened this issue 1 year ago • 3 comments

Because Lume CMS is proxying a single github user when it git commits, there's no tracking of what user made what change.

If a "save comment" field could be added to the UI, users could enter something there depending on whatever workflow they want, and the CMS could copy that into the commit message like:

Changes from CMS

RC: added paragraph on the blah blah topic...

Image

I hope you might consider this or some similar solution to let teams track what each person did, somehow.

RickCogley avatar Feb 20 '25 07:02 RickCogley

If you mean push and pull changes from the versions section in the homepage, a commit can contains changes from multiple files, so it's not so easy. Maybe I could include the user name that published the change. For GitHub storage, there's an option to customize the commit message, but it doesn't include the user name. I can look into it.

oscarotero avatar Feb 20 '25 10:02 oscarotero

that's right. When you save a single file, it doesn't make a single commit into the "version" branch? Or, does it commit all the changes across files at once, to the branch, when you click "publish"?

In the vps version, if I set up logins for people in the basic-auth section in _cms.ts, I wonder, can the CMS detect which was used to log in? I guess a cookie would be made with that info.

Thinking creatively, one thing we could do which is a little hackish, is have editors select their name from, say, a dropdown, and enter a little note in some text field about the change when they make any change. These will get put in the frontmatter, so you will be able to see it in the commit's diff if you need it. The diff would look like:

- Editor: RC
+ Editor: EI
- Note: Clarified section on topic x
+ Note: Fixed grammar

RickCogley avatar Feb 20 '25 11:02 RickCogley

Versions work in this way:

  • If you publish changes from the main branch: commit all possible changes and push to remote
  • If you publish changes from another branch: commit the possible changes in this branch, merge the branch to main and push main.
  • If you change to other branch without publishing: commit the changes in the current branch before moving to the other branch.

oscarotero avatar Feb 20 '25 11:02 oscarotero