Giter Site home page Giter Site logo

Is LFS Supported? about lefthook HOT 7 CLOSED

evilmartians avatar evilmartians commented on July 19, 2024
Is LFS Supported?

from lefthook.

Comments (7)

gabyx avatar gabyx commented on July 19, 2024 1

FYI: In https://github.com/gabyx/Githooks we run them internally.

from lefthook.

Arkweid avatar Arkweid commented on July 19, 2024

We support this list of hooks:
https://github.com/Arkweid/lefthook/blob/master/cmd/install.go#L18-L36

from lefthook.

sr9992 avatar sr9992 commented on July 19, 2024

I'm trying to get Lefthook to run Git LFS' suggested pre-push hook:

#!/bin/sh
git lfs pre-push "$@"

but when it gets executed by Lefthook, it hangs indefinitely. I believe this is because git lfs pre-push is trying to read from stdin, as is documented here:

Information about what is to be pushed is provided on the hook’s standard input with lines of the form:
<local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF

Does Lefthook pass this information to scripts? Or am I doing something wrong? Thanks!

from lefthook.

Arkweid avatar Arkweid commented on July 19, 2024

Lefthook pass information from script into. But I don't sure about this case.
You can check .git/hooks/pre-push file for debug it.

from lefthook.

muuvmuuv avatar muuvmuuv commented on July 19, 2024

This should be documented somewhere as a side effect, otherwise lefthook will override it:

Oh sorry, that does not work, it prints:

 This should be run through Git's pre-push hook.  Run `git lfs update` to install it.

post-commit:
  commands:
    lfs:
      run: git lfs post-commit {0}

pre-push:
  commands:
    lfs:
      run: git lfs pre-push {0}

post-checkout:
  commands:
    lfs:
      run: git lfs post-checkout {0}

post-merge:
  commands:
    lfs:
      run: git lfs post-merge {0}

from lefthook.

muuvmuuv avatar muuvmuuv commented on July 19, 2024

Still, I think this can be re-opened, git lfs hooks aren't executed and therefore lfs changes aren't pushed to the server. Adding lfs hooks to lefthook does not work, idk what lfs is missing in path, but it exits silently and lefthook will hang. I did not find any workaround yet...

Simple question: would it work importing lfs as a go-mod and use it directly "if it is installed"?

from lefthook.

muuvmuuv avatar muuvmuuv commented on July 19, 2024

@gabyx cool, thanks! Unfortunately, the reason we use lefthook is that I can easily install it via Homebrew (or others) and with NPM, which we use, since some of our employees use windows and have all kind of problems installing binaries ^^.

from lefthook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.