jupyterlab / jupyterlab-git

A Git extension for JupyterLab
BSD 3-Clause "New" or "Revised" License
1.44k stars 312 forks source link

Git history for a selected file #864

Closed adammclaurin closed 3 years ago

adammclaurin commented 3 years ago

It's no secret that using GitHub directly isn't great for viewing changes to Jupyter notebooks. jupyterlab-git offers some promise to make that better via integration with nbdime, but unfortunately it only seems to work by going through the history of the whole repo, which might have many changes unrelated to the file you're interested in. It'd be amazing to have a way to select a particular file to explore the history for just that one file, again with nbdime integration to be able to see the diffs clearly.

tcapelle commented 3 years ago

For github, you can use the NBReview app, it makes pull requests so much easier.

ianhi commented 3 years ago

For future reference the git command for this is:

git log --follow -p -- path-to-file

(see https://stackoverflow.com/a/5493663/835607)

So this will require:

  1. Enabling that log command in the backend
  2. Figuring out a good UI on the frontend.
fcollonval commented 3 years ago

Thanks @ianhi for the pointer

2\. Figuring out a good UI on the frontend.

While avoiding components multiplication 😉

adammclaurin commented 3 years ago

If we do implement this feature, it'd be amazing to be able to optionally ignore changes to output cells when diff'ing Jupyter notebooks.