Skip to contentSkip to conversation

perfbook v2017.01.02a tag

PATCH In review Akira Yokosawa 2 participants 4 messages Jan 2, 2017 – Jan 3, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi Paul,

I've fetched the tag "v2017.01.02a".
I suppose you may also want to update the copyright notice in the Legal statement.

Thanks, Akira

#1 lore raw
Quoted 4 lines · Akira Yokosawa

Hi Paul,

I've fetched the tag "v2017.01.02a".
I suppose you may also want to update the copyright notice in the Legal statement.

Good catch! I have updated it, but will leave v2017.01.02a alone. I guess this is good reason to release at the end of the year instead of the beginning. ;-)

Thanx, Paul

#2 lore raw

PATCH 1/1 Make date of git commit be reflected automatically

From dabed21140eee0a755c69aa1f63283fc7f7528d7 Mon Sep 17 00:00:00 2001
From: Akira Yokosawa <[email protected]>
Date: Tue, 3 Jan 2017 23:50:16 +0900
Subject: [PATCH] Make date of git commit be reflected automatically

This commit adds a script to extract git commit date info to generate autodate.tex.
If invoked on a not-clean git repository, "(m)" is appended to date field of title.
If git status is not availalbe, current date is used instead.

---
Hi Paul,

While we are at it, I made a script to automatically reflect git commit date to title and copyright notice.

As you've locally updated legal.tex, this patch will have conflict, but it should be easy for you to resolve.

I chose commit date rather than author date because what matters is when a particular patch is committed in your tree.

Thoughts?
Thanks, Akira

 .gitignore            |  1 +
 Makefile              |  7 +++++--
 legal.tex             |  2 +-
 perfbook.tex          |  1 +
 utilities/autodate.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 utilities/autodate.sh
.gitignore +1 -0
index 965b94d..3f2e4a9 100644
@@ -20,6 +20,7 @@ contrib.tex
 origpub.tex
 perfbook*.out
 perfbook-*.tex
+autodate.tex
 extraction
 embedfonts
 
Makefile +5 -2
index f446a66..151fba7 100644
@@ -7,7 +7,7 @@ LATEXSOURCES = \
 	*/*.tex \
 	*/*/*.tex
 
-LATEXGENERATED = qqz.tex contrib.tex origpub.tex
+LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
 
 ABBREVTARGETS := 1c hb mss mstx msr msn msnt 1csf
 
@@ -71,9 +71,12 @@ $(PDFTARGETS): %.pdf: %.tex %.bbl
 $(PDFTARGETS:.pdf=.bbl): %.bbl: %.aux $(BIBSOURCES)
 	bibtex $(basename $@)
 
-$(PDFTARGETS:.pdf=.aux): $(LATEXSOURCES) $(LATEXGENERATED)
+$(PDFTARGETS:.pdf=.aux): $(LATEXGENERATED) $(LATEXSOURCES)
 	sh utilities/runfirstlatex.sh $(basename $@)
 
+autodate.tex: $(LATEXSOURCES) $(BIBSOURCES) $(SVGSOURCES) $(FIGSOURCES) $(DOTSOURCES)
+	sh utilities/autodate.sh >autodate.tex
+
 perfbook_flat.tex: perfbook.tex $(LATEXSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
 	echo > qqz.tex
 	echo > contrib.tex
legal.tex +1 -1
index e5cf1c8..965c76e 100644
@@ -42,6 +42,6 @@ for the exact licenses.
 If you are unsure of the license for a given code fragment,
 you should assume GPLv2-only.
 
-Combined work {\textcopyright}~2005-2016 by Paul E. McKenney.
+Combined work {\textcopyright}~2005-\commityear\ by Paul E. McKenney.
 
 \IfTwoColumn{\twocolumn}{}
perfbook.tex +1 -0
index 4e6a173..ea063dc 100644
@@ -105,6 +105,7 @@
 	\href{mailto:[email protected]}{[email protected]} \\
 } % end author
 % \date{\ }
+\input{autodate}
 
 \setcounter{topnumber}{3}
 \renewcommand\topfraction{.75}
utilities/autodate.sh new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

Re: [PATCH] Make date of git commit be reflected automatically

Quoted 18 lines · Akira Yokosawa
Quoted 1 line

From dabed21140eee0a755c69aa1f63283fc7f7528d7 Mon Sep 17 00:00:00 2001

From: Akira Yokosawa <[email protected]>
Date: Tue, 3 Jan 2017 23:50:16 +0900
Subject: [PATCH] Make date of git commit be reflected automatically

This commit adds a script to extract git commit date info to generate autodate.tex.
If invoked on a not-clean git repository, "(m)" is appended to date field of title.
If git status is not availalbe, current date is used instead.

---
Hi Paul,

While we are at it, I made a script to automatically reflect git commit date to title and copyright notice.

Quoted 7 lines

As you've locally updated legal.tex, this patch will have conflict, but it should be easy for you to resolve.

I chose commit date rather than author date because what matters is when a particular patch is committed in your tree.

Thoughts?

Very nice! I have queued and pushed it.

Thanx, Paul

Quoted 131 lines

Thanks, Akira

 .gitignore            |  1 +
 Makefile              |  7 +++++--
 legal.tex             |  2 +-
 perfbook.tex          |  1 +
 utilities/autodate.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 utilities/autodate.sh
.gitignore +1 -0
index 965b94d..3f2e4a9 100644
@@ -20,6 +20,7 @@ contrib.tex
 origpub.tex
 perfbook*.out
 perfbook-*.tex
+autodate.tex
 extraction
 embedfonts
 
Makefile +5 -2
index f446a66..151fba7 100644
@@ -7,7 +7,7 @@ LATEXSOURCES = \
 	*/*.tex \
 	*/*/*.tex
 
-LATEXGENERATED = qqz.tex contrib.tex origpub.tex
+LATEXGENERATED = autodate.tex qqz.tex contrib.tex origpub.tex
 
 ABBREVTARGETS := 1c hb mss mstx msr msn msnt 1csf
 
@@ -71,9 +71,12 @@ $(PDFTARGETS): %.pdf: %.tex %.bbl
 $(PDFTARGETS:.pdf=.bbl): %.bbl: %.aux $(BIBSOURCES)
 	bibtex $(basename $@)
 
-$(PDFTARGETS:.pdf=.aux): $(LATEXSOURCES) $(LATEXGENERATED)
+$(PDFTARGETS:.pdf=.aux): $(LATEXGENERATED) $(LATEXSOURCES)
 	sh utilities/runfirstlatex.sh $(basename $@)
 
+autodate.tex: $(LATEXSOURCES) $(BIBSOURCES) $(SVGSOURCES) $(FIGSOURCES) $(DOTSOURCES)
+	sh utilities/autodate.sh >autodate.tex
+
 perfbook_flat.tex: perfbook.tex $(LATEXSOURCES) $(PDFTARGETS_OF_EPS) $(PDFTARGETS_OF_SVG)
 	echo > qqz.tex
 	echo > contrib.tex
legal.tex +1 -1
index e5cf1c8..965c76e 100644
@@ -42,6 +42,6 @@ for the exact licenses.
 If you are unsure of the license for a given code fragment,
 you should assume GPLv2-only.
 
-Combined work {\textcopyright}~2005-2016 by Paul E. McKenney.
+Combined work {\textcopyright}~2005-\commityear\ by Paul E. McKenney.
 
 \IfTwoColumn{\twocolumn}{}
perfbook.tex +1 -0
index 4e6a173..ea063dc 100644
@@ -105,6 +105,7 @@
 	\href{mailto:[email protected]}{[email protected]} \\
 } % end author
 % \date{\ }
+\input{autodate}
 
 \setcounter{topnumber}{3}
 \renewcommand\topfraction{.75}
utilities/autodate.sh new file +48 -0
new file mode 100644
index 0000000..6df8f99
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Extract git commit date info to generate autodate.tex.
+# If invoked on not-clean git repository, append "(m)" to date field
+# for title.
+# If git status is not availabe, use current date instead.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can access it online at
+# http://www.gnu.org/licenses/gpl-2.0.html.
+#
+# Copyright (C) Akira Yokosawa, 2017
+#
+# Authors: Akira Yokosawa <[email protected]>
+
+export LC_TIME=C
+# check if we are in git repository
+if ! test -e .git
+then
+	date_str=`date -R`
+	modified=""
+else
+	date_str=`git show --format="%cD" | head -1`
+	# check if git status is clean
+	gitstatus=`git status --porcelain | wc -l`
+	if [ $gitstatus != "0" ]
+	then
+		modified=" (m)"
+	else
+		modified=""
+	fi
+fi
+month=`date --date="$date_str" +%B`
+year=`date --date="$date_str" +%Y`
+day=`date --date="$date_str" +%e`
+
+echo "\\date{$month $day, $year$modified}"
+echo "\\\newcommand{\\\commityear}{$year}"
Signature · 1 line
2.7.4