gitfourchette icon indicating copy to clipboard operation
gitfourchette copied to clipboard

Staging an LFS tracked file does not seem to apply the configured hooks.

Open david0sen opened this issue 4 months ago • 3 comments

When staging an LFS tracked file, the file is staged as a regular file, rather than being processed by the LFS hooks to end up with a hash text file.

For the time being, I created a command "Add to staging" that runs git add on the selected file(s).

If the independence of git means bypassing the git configs, perhaps it is better to depend on installed git, maybe as a dependency for the install package... Anyway, just a thought.

Happy to provide more information if needed.

david0sen avatar Aug 11 '25 13:08 david0sen

Thank you for reporting this! This lets me know there's interest in using LFS with GitFourchette and helps me decide where to focus my efforts.

LFS isn't supported yet, because libgit2 has no built-in support for hooks, and I haven't implemented this separately.

However, I happen to be working on "vanilla git" implementations for some core tasks - that is, some tasks like "stage" would run git commands under the hood instead of doing everything via libgit2. This should solve some of our current limitations (like hooks).

I'm planning to make this available in the next release, hopefully by September. Stay tuned...

jorio avatar Aug 12 '25 23:08 jorio

GitFourchette v1.5.0 now uses vanilla git to stage/unstage files, make commits, switch branches, push, pull, etc. So, LFS hooks should run seamlessly.

However, please note that the UI itself isn't LFS-aware yet! The following limitations apply:

  • Clicking on an LFS object that you've just staged will show you a diff of the LFS pointer instead of the actual contents of the file. (This is as expected because that's what's in the index as far as git is concerned - the full file is still in your workdir after staging.)
  • Exploring past commits only displays diffs of LFS pointers.
  • In past commits, context menu commands like "Restore File Revision", "Save a Copy" will manipulate LFS lightweight pointers only.
  • Solving merge conflicts via the UI may leave LFS placeholders in your workdir. You may have to call git lfs checkout manually to restore file contents.

(Tip: If you find yourself falling back to git lfs checkout often, you can create a Custom Command to add git lfs checkout $FILE to file context menus.)

I might add full LFS support in a later release if there is interest for it.

jorio avatar Sep 09 '25 20:09 jorio

Hello, I'm enjoying using the app through flatpak - I just wanted to second interest in having lfs support as that is the main thing limiting my workflow with this application currently. Thanks for the good work on this^

animatorkris avatar Oct 24 '25 05:10 animatorkris