alerque / git-warp-time

Rust library and CLI utility to reset timestamps of Git repository files to the time of the last modifying commit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Git LFS files result in errors

aminya opened this issue · comments

When I try to use git-warp-time to reset the times, I get an error that <the list of files in git lfs> are not tracked in the repository.

format!("Paths {not_tracked:?} are not tracked in the repository");

Is it possible to support git-lfs?

I'm sure it's possible, I just don't have much expertise with git lfs. I'm more of a git annex guy myself! I don't know when/if I'll be able to fiddle with this myself, but it probably isn't too hard to actually do.

I presume libgit2 supports it, we just have to add some incantations to mix in LFS tracked files to the list of things we attempt to act on, and then also possibly add a different way to lookup their last changed timestamp.

I'd be happy to help facility a fix getting merged and released if you or anyone wants to jump into this.

I'll also just note that I recently considered switching from libgit2 to gitoxide. I ran into some trouble with incomplete API coverage, but if anybody happened to want to run with that I'd be happy to see it happen. If that made it easier (or harder) to support LFS that would factor in too. I'll post my WIP as a draft so anybody could tinker with it from there.

For the start, if there is a way to ignore untracked files like Git LFS files, it would be great.

@aminya I don't understand that commend, git warp-time already ignores untracked files. By default it works only on a list of tracked files.

I'm guessing the actual problem is that the mechanism being used to find a list of tracked files is returning LFS tracked files, but the mechanism used to retrieve history can't find any and falsely concludes they are not tracked. Yes, a way to catch and exclude LFS from our collection of "tracked" files we try to operate on would be welcome as a starting point if that's easier to implement than walking LFS history.