obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Feature]: Add {{author}} to the commit template

Open dhmmasson opened this issue 1 year ago • 1 comments
trafficstars

Description

Obsidian-git facilitates collaboration on a single Obsidian vault by allowing users to synchronize their vault to a remote Git repository. However, in the current implementation, one cannot specify the author in the automatic backup/commit messages. This feature becomes crucial in collaborative environments where multiple users contribute to the same Obsidian vault.

Proposed Enhancement

Introduce a new variable, {{author}}, to Obsidian-git commit messages template.

Use Case

In scenarios where multiple users are collaborating on a shared Obsidian vault, the ability to attribute changes to specific authors enhances transparency and accountability.

Additional Context

Obsidian-git already supports the use of {{hostname}} in commit messages for situations where a single user manages notes across different devices. Extending this support to include {{author}} would provide a comprehensive solution for both single-user and collaborative environments.

Example

Commit message on auto backup/commit
vault backup: {{date}} - {{author}
vault backup: 2024-02-16 - dhmmasson

dhmmasson avatar Feb 16 '24 11:02 dhmmasson

What's the benefit of showing the author name in the commit message if the commit already contains the author, which is shown in git log or GitHub commit history as well?

Vinzent03 avatar Feb 21 '24 23:02 Vinzent03

Thank your for your response.

The benefit is to see it in the history view in obsidian : Screen Shot 2024-02-25 at 17 55 03.

I think I went from the idea of the {{date}} that is also in the commit. That Backup is the backup of the modification by X at T. it was simple and customizable.

But you are right that it could be directly displayed in the history view from the commit info instead of embedded in the message, that would probably imply having a set of options similar to the line-authoring. Allowing to customize

  • Author name display (none, initials, fullname...)
  • Author name position (before|after)
  • Authoring date display

Would you be interested in a PR to support that feature ?

dhmmasson avatar Feb 25 '24 16:02 dhmmasson

I've added the feature now myself, but thanks for offering to contribute. There are now two new options in the settings.

Vinzent03 avatar Mar 04 '24 20:03 Vinzent03

Thank you for adding that feature! It would have been a pleasure to contribute directly as I really appreciate your plugin. I'll gladly contribute to other issues if you are interested.

Best,

dhmmasson avatar Mar 05 '24 22:03 dhmmasson