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

Allow pushing data in the pre-commit hook #8360

Open
HMJiangGatech opened this issue Nov 11, 2024 · 1 comment
Open

Allow pushing data in the pre-commit hook #8360

HMJiangGatech opened this issue Nov 11, 2024 · 1 comment

Comments

@HMJiangGatech
Copy link

In the pre-commit hook (e.g., lua hook), I'm looking for a way to write into the repo.

Example, I structure my repo as

data/ # multiple json
stats.txt

Then I want to have a pre-commit hook to always count how many files in data, and write that into the stats.txt, e.g.,

Number of files in data/ are 107 .

I know I can publish somewhere else, e.g., a s3 location. But I'm looking for a solution to directly write into the repo.

@talSofer
Copy link
Contributor

Thanks for opening this request @HMJiangGatech!

To assist in finding the right solution for your use case, do you mind answering these questions:

  • At the end of what process are you committing? What does it do?
  • How do you later use the file count in stats.txt?

I'm asking because the following solution may better fit your use case:

  • Add a step to the process that modifies the data/ prefix and make it update stats.txt with the file count
  • Implement a pre-commit hook that validates that stats.txt exists and was modified (rather than writing to lakeFS)

Do you think this would work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants