chaitin / strapdown-zeta

Instant and elegant Markdown documents in the browser, Git powered markdown wiki server, mathjax and theme support, and many more features!
http://strapdown.ztx.io
Other
166 stars 44 forks source link

A beautiful git diff page #35

Closed zTrix closed 8 years ago

zTrix commented 9 years ago

Current diff page is tooooooo simple!

jamesliu96 commented 9 years ago

what you mean by simple? need any more features or just optimize UI?

zTrix commented 9 years ago

A more user-friendly git diff page, like gitlab or github, with color support, line number, single file view/split view.

jamesliu96 commented 9 years ago

got it

jamesliu96 commented 9 years ago

Highlight completed.

TODO:

  1. line number
  2. single file view/split view
jamesliu96 commented 8 years ago

https://raw.githubusercontent.com/jay/showlinenum/develop/showlinenum.awk here is a sample of adding line number, yet it needs shell so it is not a good solution. We might have to modify the git2go package.

zTrix commented 8 years ago

Emm, don't use shell and awk...

jamesliu96 commented 8 years ago

found XSS vulnerability in diff page

zTrix commented 8 years ago

But we do not have a account system.. 2333

BTW, what's the vulnerability you found?

jamesliu96 commented 8 years ago

Both "line number" and "single file view/split view" features needs to modify backend, libgit2

zTrix commented 8 years ago

How does gitlab/gogs/gitup implement the diff function?

pandada8 commented 8 years ago

gitlab: generated by backend gogs: generated by backend

https://github.com/gogits/gogs/blob/3a81fdf092a39cc94f3bb896a42db8546bd5f39a/models/git_diff.go https://github.com/gogits/gogs/blob/0af035c37e8b561662c93b163b3294b91be6ffac/templates/repo/diff_box.tmpl code from gogs

zTrix commented 8 years ago

invoke Process and call git seems totaly not safe yet the only solution...

jamesliu96 commented 8 years ago

how does Reviewable generate the diff page?

zTrix commented 8 years ago

open source?

jamesliu96 commented 8 years ago

I don't think so. But it seems to be generating diff on front end.

virusdefender commented 8 years ago

https://github.com/chaitin/strapdown-zeta/pull/89

with diff2html