mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
tools: dayssincerelease.hs -> dayssincetag.hs
This commit is contained in:
parent
42df61393b
commit
7e753e13b5
10
Makefile
10
Makefile
@ -806,19 +806,21 @@ showreleasestats stats: \
|
||||
# simplebench
|
||||
# showerrors
|
||||
|
||||
FROMTAG=.
|
||||
|
||||
showreleasedays:
|
||||
@echo Days since last release:
|
||||
@tools/dayssincerelease.hs | head -1 | cut -d' ' -f-1
|
||||
@tools/dayssincetag.hs $(FROMTAG) | head -1 | cut -d' ' -f-1
|
||||
@echo
|
||||
|
||||
showunreleasedchangecount:
|
||||
@echo Commits since last release:
|
||||
@darcs changes --from-tag . --count
|
||||
@darcs changes --from-tag $(FROMTAG) --count
|
||||
@echo
|
||||
|
||||
showreleaseauthors:
|
||||
@echo Patch authors since last release:
|
||||
@darcs changes --from-tag . |grep '^\w' |cut -c 31- |sort |uniq
|
||||
@darcs changes --from-tag $(FROMTAG) |grep '^\w' |cut -c 31- |sort |uniq
|
||||
@echo
|
||||
|
||||
showloc sloccount:
|
||||
@ -850,7 +852,7 @@ showunpushedchanges unpushed:
|
||||
|
||||
showunreleasedcodechanges unreleased:
|
||||
@echo "hledger code changes since last release:"
|
||||
@darcs changes --from-tag . --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
|
||||
@darcs changes --from-tag $(FROMTAG) --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
|
||||
@echo
|
||||
|
||||
showcodechanges:
|
||||
|
@ -5,15 +5,17 @@ Similar to:
|
||||
$ darcs changes --to-tag . --from-tag .|head -n 1 |cut -d' ' -f-7 |xargs -I {} date -d "{}" +%s |xargs -I {} expr \( $(date +%s) - {} \) / 60 / 60 / 24
|
||||
-}
|
||||
import Data.Time
|
||||
import System.Environment
|
||||
import System.Locale
|
||||
import System.Process
|
||||
|
||||
main = do
|
||||
s <- readProcess "darcs" ["changes","--from-tag",".","--to-tag","."] ""
|
||||
tag:_ <- getArgs
|
||||
s <- readProcess "darcs" ["changes","--from-tag",tag,"--to-tag",tag] ""
|
||||
let datestr = unwords $ take 6 $ words $ head $ lines s
|
||||
date = readTime defaultTimeLocale "%a %b %e %H:%M:%S %Z %Y" datestr :: Day
|
||||
today <- getCurrentDay
|
||||
putStrLn $ show (diffDays today date) ++ " days since the last tag:\n"
|
||||
putStrLn $ show (diffDays today date) ++ " days since tag "++tag++":\n"
|
||||
putStr s
|
||||
|
||||
getCurrentDay = do
|
Loading…
Reference in New Issue
Block a user