Matplotlib axes id conflicting with git

I have an issue linked to the axis of matplotlib and the git_hooks installed by nbdev.
When you plot a figure and return the axes, you often get and output of the form:

<matplotlib.axes._subplots.AxesSubplot at 0x7fe5746b59d0>

somewhere in your notebook, and each time you run them, git will complain that this hash change everytime you run the notebook (and he is right).

git diff
diff --git a/01_mesh.ipynb b/01_mesh.ipynb
index 4d04c1d..e252091 100644

--- a/01_mesh.ipynb
+++ b/01_mesh.ipynb
@@ -733,7 +733,7 @@
     {
      "data": {
       "text/plain": [
-       "<matplotlib.axes._subplots.AxesSubplot at 0x7fda56a85750>"
+       "<matplotlib.axes._subplots.AxesSubplot at 0x7fe5746b59d0>"
       ]
      },
      "execution_count": null,

Maybe add something to git_hooks to ignore this?
or maybe I am just to used to return the axes of my plot methods, and it not a good practice.

Well the output of your cell did change, and since we are not stripping that (otherwise you get no doc), it’s normal you get it in the diff. Note that in case of conflicts, nbdev_fix_merge merges the conflicts in outputs automatically, so this should not be too annoying.

Also, just adding a ; at the end of your code cell will make the output not show.

I am just not returning ax anymore =)