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

Online Diff #10

Open
gaocegege opened this issue Oct 27, 2017 · 1 comment
Open

Online Diff #10

gaocegege opened this issue Oct 27, 2017 · 1 comment

Comments

@gaocegege
Copy link
Member

利用 GitHub Compare Feature 实现 Online Diff

GitHub Compare Feature 只支持单文件的 commit 历史版本比对,为了利用,可以 commit latest.md in one commit and save the commit id for every markdown file.

@gaocegege
Copy link
Member Author

实现

CopyFile(latestHTML, persistentHTML)
CopyFile(bufHTML, latestHTML)
CopyFile(latestMarkdown, persistentMarkdown)
m.gitManager.AddAndCommit(fmt.Sprintf("%s: Update %s", source.Name, persistentMarkdown))

CopyFile(bufMarkdown, latestMarkdown)
m.gitManager.AddAndCommit(fmt.Sprintf("%s: Changes", source.Name))
// Record the commit ID via `git log -n1 --format="%H"` and write it to <persistentName>.yml

Show diff via https://github.com/siglt/tosknight-storage/commit/<commid ID>?diff=split

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@gaocegege and others