mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Use git describe for doc HTML output
* Rakefile (:doc:upload): * doc/yas-doc-helper.el: Use 'git describe' output instead of 'git rev-parse', since it's more readable.
This commit is contained in:
parent
4ef1768e81
commit
28d5496144
6
Rakefile
6
Rakefile
@ -76,16 +76,12 @@ namespace :doc do
|
|||||||
Dir.glob("doc/stylesheets/*.css").each do |file|
|
Dir.glob("doc/stylesheets/*.css").each do |file|
|
||||||
FileUtils.cp file, 'doc/gh-pages/stylesheets'
|
FileUtils.cp file, 'doc/gh-pages/stylesheets'
|
||||||
end
|
end
|
||||||
curRev = `git rev-parse --verify HEAD`.chomp()
|
curRev = `git describe`.chomp()
|
||||||
expRev = IO.read('doc/html-revision').chomp()
|
expRev = IO.read('doc/html-revision').chomp()
|
||||||
if curRev != expRev
|
if curRev != expRev
|
||||||
raise ("The HTML rev: #{expRev},\n" +
|
raise ("The HTML rev: #{expRev},\n" +
|
||||||
"current rev: #{curRev}!\n")
|
"current rev: #{curRev}!\n")
|
||||||
end
|
end
|
||||||
if !system "git diff-index --quiet HEAD"
|
|
||||||
system "git status --untracked-files=no"
|
|
||||||
raise "You have uncommitted changes!"
|
|
||||||
end
|
|
||||||
Dir.chdir 'doc/gh-pages' do
|
Dir.chdir 'doc/gh-pages' do
|
||||||
sh "git commit -a -m 'Automatic documentation update.\n\n" +
|
sh "git commit -a -m 'Automatic documentation update.\n\n" +
|
||||||
"From #{curRev.chomp()}'"
|
"From #{curRev.chomp()}'"
|
||||||
|
@ -125,12 +125,12 @@
|
|||||||
;; build, don't depend on git.
|
;; build, don't depend on git.
|
||||||
(rev (unless src-epoch
|
(rev (unless src-epoch
|
||||||
(ignore-errors
|
(ignore-errors
|
||||||
(car (process-lines "git" "rev-parse" "--verify" "HEAD")))))
|
(car (process-lines "git" "describe" "--dirty")))))
|
||||||
(date (format-time-string
|
(date (format-time-string
|
||||||
"(%Y-%m-%d %H:%M:%S)"
|
"(%Y-%m-%d %H:%M:%S)"
|
||||||
(seconds-to-time
|
(seconds-to-time
|
||||||
(string-to-number
|
(string-to-number
|
||||||
(or (if rev (car (process-lines "git" "show" "--format=%ct" rev))
|
(or (if rev (car (process-lines "git" "show" "--format=%ct"))
|
||||||
src-epoch)
|
src-epoch)
|
||||||
"0")))
|
"0")))
|
||||||
t))
|
t))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user