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

Add a gitfilter to clean the output and metadata from an ipynb #2514

Closed
wants to merge 1 commit into from

Conversation

basnijholt
Copy link
Contributor

@basnijholt basnijholt commented Apr 3, 2018

Regarding #1617 and #2507.

What about this?

You activate the filter with:

git config filter.nbstrip_jq.clean './nbstrip_jq.sh'
git config filter.nbstrip_jq.smudge cat
git config filter.nbstrip_jq.required true

@jlstevens
Copy link
Contributor

jlstevens commented Apr 3, 2018

Thanks @basnijholt for the suggestion!

It is good to have a concrete proposal like this but I think there is more discussion to be had:

  1. We would prefer to have a solution that doesn't require jq
  2. Can the filter only apply to specific directories?
  3. Very occasionally we might want to commit notebooks with some output. How would you handle that if such a situation arises?
  4. We probably need an approach that also helps contributors who aren't regular enough developers that they would want to set up the git filters. For instance, a common, user-friendly command...
  5. My ideal git filter would be one which applies when you stage a change, before you make the commit. This would give me the option to see the diff e.g if I work on a new machine where I haven't got the git filters configured.

At any rate, I think once we've thought it all through, git filters should be documented for the developers who want to use them.

@basnijholt
Copy link
Contributor Author

This is another solution using nbconvert although it doesn't do all of the things @jlstevens mentioned above.

@philippjfr
Copy link
Member

Will close and maybe use your nbconvert solution.

@philippjfr philippjfr closed this Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants