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

A %revisions magic to show revisions from a repository #74

Closed
BoPeng opened this issue May 10, 2018 · 13 comments
Closed

A %revisions magic to show revisions from a repository #74

BoPeng opened this issue May 10, 2018 · 13 comments

Comments

@BoPeng
Copy link
Contributor

BoPeng commented May 10, 2018

Something like what the following (a screenshot from workflowr). It can be difficult to do this from a web environment because the frontend in theory does not touch host file system. The kernel can somehow call git log and parse its output though.

2018-05-10-09-15-26_scrot

@gaow
Copy link
Member

gaow commented May 18, 2018

This would be a great feature to have -- very appealing.

I think it would be even better to do this:

%revisions --source https://github.com/stephenslab/gtexresults/blob/{revision}/analysis/Fig.Uk3.Rmd --html https://cdn.rawgit.com/stephenslab/gtexresults/{revision}/docs/Fig.Uk3.html

then under the hood, the output would look like:

Revision Version Author Date Message
18 80f285fa [source/html] Gao Wang 2017-05-30 Update figures

That is a easy way to mimic what workflowr does, and is more compact (consolidating source and HTML) and flexible (we can support via this type of template not just github links).

@BoPeng
Copy link
Contributor Author

BoPeng commented May 18, 2018

We should be able to figure out source automatically through the git remote show origin, right? html is another story because it points to another file.

@gaow
Copy link
Member

gaow commented May 18, 2018

Sure, but that requires password for private repo unless some ssh token is set. Also it does not expand the rest of the URL which might have different convention in different hosting services I suspect. I think it is good enough to use some solution that requires explicit specification like that in order for hyper-links to show up. One only has to do this once per notebook and will never have to worry about keeping different versions of the notebook because it is so easy to track it back. That should make implementation easier?

@gaow
Copy link
Member

gaow commented May 18, 2018

Oh and Version should show the git tag when applicable?

BoPeng pushed a commit that referenced this issue May 18, 2018
BoPeng pushed a commit to vatlab/sos-docs that referenced this issue May 18, 2018
@BoPeng
Copy link
Contributor Author

BoPeng commented May 18, 2018

Implemented and documented here. Let me know if you have any comment.

@gaow
Copy link
Member

gaow commented May 18, 2018

Oh it looks fantastic! Perhaps only one thing for now: can we add a toggle one way or another? A notebook maybe revised many times. Without a toggling I'd put this table at the end of a notebook where I have %sessioninfo, which is a bit messy. A toggle would be good.

@gaow
Copy link
Member

gaow commented May 18, 2018

Sorry, I just noticed -n option. So with -n I guess we can live without toggle.

@BoPeng
Copy link
Contributor Author

BoPeng commented May 18, 2018

Yes, there are a lot of options for git log and you can pick which revisions to display. I though of a default -n 10 but decide not to change the default behavior of git log.

@BoPeng BoPeng closed this as completed May 25, 2018
@BoPeng
Copy link
Contributor Author

BoPeng commented Aug 6, 2018

@gaow What is the link for workflowr with revisions of figures? I recently found nbdime which can achieve similar effect and I would like to propose the workflowr diff format for it.

@gaow
Copy link
Member

gaow commented Aug 6, 2018

@BoPeng Are you asking about an example? Here is one:

https://stephenslab.github.io/gtexresults/Uk3.html

Please let me know if it is what you need!

@BoPeng
Copy link
Contributor Author

BoPeng commented Aug 6, 2018

I am looking for an example with some thing that expands previous version of figure.

@gaow
Copy link
Member

gaow commented Aug 6, 2018

Yes that link should demonstrate it.

@BoPeng
Copy link
Contributor Author

BoPeng commented Aug 6, 2018

Thanks. I submitted a ticket and asked how difficult it is to do so with notebook/nbdime.

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

No branches or pull requests

2 participants