Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I know the last commit time and message? #334

Closed
qiaoxingxing opened this issue Oct 11, 2022 · 5 comments
Closed

How do I know the last commit time and message? #334

qiaoxingxing opened this issue Oct 11, 2022 · 5 comments

Comments

@qiaoxingxing
Copy link

Every morning at the office , I need to check the last commit time to confirm I haven't forgotten to commit and push at home last night.

I have to open a terminal and type "git log". How can I do it within obsidian?

@Vinzent03
Copy link
Owner

When you pull in Obsidian, you should get a notice of the changed files count. This could help you to determine whether you have new changes or not. But this does not tell you the date of the last commit.

@qiaoxingxing
Copy link
Author

qiaoxingxing commented Oct 12, 2022

@Vinzent03
It helps, thanks

@qiaoxingxing
Copy link
Author

Finally, I find a way to do this by using plugins Templater and Hotkeys for templates.

  1. define a new system command in templater.
name: gitlog 
cmd: git log --pretty=format:'%s' -5
  1. add a template file git-log.md
<%_* 
const msgs = await tp.user.gitlog()
const array = msgs.split("\n")
//show a model listing latest commits
await tp.system.suggester(array,array)
//to avoid lost data
tR += tp.file.selection();
_%>
  1. add hotkey for this template in setting

@Vinzent03
Copy link
Owner

That's great! I'm still thinking about a good way to maybe show that in Obsidian as well. Maybe another statusbar entry?

@mkczyk
Copy link

mkczyk commented Mar 19, 2023

I'm still thinking about a good way to maybe show that in Obsidian as well.

Maybe just "git log" in Obsidian Git like in this feature request?

For those who still looking for solution (and don't want to use Templater for some reasons), you can use plugins Shell Command + Commander and put icon with your command for example gitk. With this you can quickly see last commit time and message (see Workaround section for details: #472).

Vinzent03 added a commit that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants