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

Figure out notebook pre-commit hooks vs. post-commit stripping #140

Open
jcohenadad opened this issue Oct 31, 2024 · 4 comments
Open

Figure out notebook pre-commit hooks vs. post-commit stripping #140

jcohenadad opened this issue Oct 31, 2024 · 4 comments

Comments

@jcohenadad
Copy link
Contributor

jcohenadad commented Oct 31, 2024

Oops! I became lazy to remove my notebook outputs before committing, thinking that GHA would take care of it, but I guess the difference with a pre-commit hook, is that the commit with the notebook outputs becomes part of the git history, and then a bot strips it out and add another commit to it:

image

This is pretty annoying. I guess I should be looking at pre-commit hook approach, unless there is another solution?

@jcohenadad
Copy link
Contributor Author

In fact, the auto-strip commit is annoying because it systematically creates a conflict on the local branch:

image

We should probably get rid of it...

jcohenadad added a commit that referenced this issue Oct 31, 2024
@mathieuboudreau
Copy link
Member

Maybe this? https://zhauniarovich.com/post/2020/2020-06-clearing-jupyter-output/

@mguaypaq
Copy link

mguaypaq commented Nov 1, 2024

The updated post using git attributes is pretty nice:
https://zhauniarovich.com/post/2020/2020-10-clearing-jupyter-output-p3/

It's very similar to how git-annex already works.

@jcohenadad
Copy link
Contributor Author

Thank you @mathieuboudreau and @mguaypaq , I will try that and post feedback

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

3 participants