Need help with isomorphic-git not being able to fetch git.log due to TypeError (reading 'bind')

I want to extend the recent-notes plugin with the last commit date as modified date.

1 Like

Doesn’t the recent notes plugin work independently of git and instead uses obsidian api to detect changes?

yes, but we want to introduce custom “modified date” possibilities, like I already sent a PR which uses a frontmatter property.

So I should install a file system like LightningFS? But why is vault.adapter working in obsidian-git then?

As I dive further into obsidian-git, I’m starting to get suspicious about the plugin implementing a custom filesystem…

How would you implement this with simplegit? I just want to have the last commit date of a specific file.

Thanks, now I understand that Obsidian does not provide me with that “file system”. Imagine, I’ve spent 3 days now with this… but leaning a lot about typescript and plugins. I’s all new for me.

funny enough im actly building a git changelog plugin that already has this logic and i guess this functionality could be integrated into recent files plugin if wanted.

but honestly shouldnt just showing the actual file modification time of those files in the recent files list be more logical? introducing git just for this seems like overkill

1 Like

OK, using @isomorphic-git/lightning-fs solved the issue. Thanks guys!
I now receive errors sent by git, which will be an entirelly different thread… :smiley:

1 Like

Yes, that’s why I asked for help from you.
Quick question: do you know why I receive this error?

Uncaught (in promise) NotFoundError: Could not find master.
    at _GitRefManager.resolve (plugin:sample-plugin:8188:11)
    at async _log (plugin:sample-plugin:10229:15)
    at async log (plugin:sample-plugin:10348:12)

git log in the terminal gives me:

commit 968bdd2877b57443db2fce6de464eb54865556f5 (HEAD -> master)
Author: Sans <>
Date:   Wed Feb 19 14:45:49 2025 +0100
    vault backup: 2025-02-19 14:45:49





As for your other remark, the file date can change without any actual modifications in the file (like accidental keypress, sync). I always commit my changes in the vault in git. So that information is more useful for me in terms modification history.

I don’t understand, any of those small changes will be detected and committed by git too?

I don’t know what that error is about but you should definitely use -z flag in compatible git commands when running any kind of scripts and functions because that gives the output intended for machine parsing.

Honestly I don’t see why you think that messing with isomorphic gi is worth it for your case.
Trust me, working with simplegit was a lot of headache for me, and isomorphic git is probably even worse.

The only reason I chose that was it promises to run on mobile too whereas simplegit does not allegedly.

Not in my case, I turned automatic commiting off. So I only commit when I truly modified a note.

yea ik that. i meant messing with git and javascript overall :smile:
i guess it makes sense if u rly want your feature

My point was that master ref is definitely present as is HEAD. So I wonder why isomorphic-git doesnt find them.

eh i guess its isomorphic git stuff, cant help you there

1 Like

Is your code for getting changelog via simplegit public? I would like to try it and if it works I might use it with recent-notes.

I’m starting to get a hang of this. LightningFS is actually a file system in the browser, and thus has nothing to do with Obsidian’s files which are in the file system. That’s why isomorphic-git can’t find the HEAD.
And that is why obsidian-git actually implemented their own filesystem that maps Obsidian’s files to isomorphic-git. I might just steal that code one day :slight_smile:

1 Like

I will release the plugin publicly, just have to polish it up. Optimistically in 4-5 days, but probably around the start of march.

1 Like

do you myb know how to “extract” the result of a git diff between 2 commits to a whole separate repo in practicality (either an actual new repo or some temporary state)

to clarify: create a new virtual/real repo with only the changes. so if a git diff had 2 files and 6 lines changed, thats whats the extracted repo should contain only

this would let me compute changelogs incrementally without having to recalculate everything each time (example user autocommits every 2 minutes) but i dont know of a way to do this nicely.