All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: virtio-comment@lists.oasis-open.org
Subject: [virtio-comment] [mst@redhat.com: Re: [virtio-comment] [RFC PATCH  7/8] make*: remove reliance on REVISION-DATE and use git]
Date: Thu, 30 Apr 2020 03:46:17 -0400	[thread overview]
Message-ID: <20200430034518-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200327103803.10460-8-alex.bennee@linaro.org>

Forgot to Cc list by mistake.
Apropos, please do not copy both virtio-dev and virtio-comment.
virtio-dev is for implementation, virtio-comment for spec feedback.

----- Forwarded message from "Michael S. Tsirkin" <mst@redhat.com> -----

Date: Thu, 30 Apr 2020 03:44:57 -0400
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alex Bennée <alex.bennee@linaro.org>
Subject: Re: [virtio-comment] [RFC PATCH  7/8] make*: remove reliance on REVISION-DATE and use git
Message-ID: <20200430034211-mutt-send-email-mst@kernel.org>
In-Reply-To: <20200327103803.10460-8-alex.bennee@linaro.org>

On Fri, Mar 27, 2020 at 10:38:02AM +0000, Alex Bennée wrote:
> Rather than manually tweaking REVISION-DATE and loading it into
> DATESTR move all the logic into make-setup-generated.sh. While we are
> at it we can query git directly for the state of tree and use that to
> fill in the meta-data.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

I frankly find it more robust not to depend on current date,
git tags, or anything like this. People should be able to
generate exactly the same pdf/html from same sources without effort.
Additionally, it needs to be possible to build from tarball,
not just from git.

One exception where it's not possible ATM is
with redline, that requires git. Would be nice to fix.

> ---
>  REVISION-DATE           |  1 -
>  make-setup-generated.sh | 54 +++++++++++++++++++++++++++++------------
>  makeall.sh              |  1 -
>  makediff.sh             |  1 -
>  makediffall.sh          |  1 -
>  makediffwithbase.sh     |  1 -
>  maketex.sh              |  1 -
>  makezip.sh              |  2 --
>  8 files changed, 38 insertions(+), 24 deletions(-)
>  delete mode 100644 REVISION-DATE
> 
> diff --git a/REVISION-DATE b/REVISION-DATE
> deleted file mode 100644
> index 59c9d17..0000000
> --- a/REVISION-DATE
> +++ /dev/null
> @@ -1 +0,0 @@
> -11 April 2019
> diff --git a/make-setup-generated.sh b/make-setup-generated.sh
> index f15d148..2faea0b 100755
> --- a/make-setup-generated.sh
> +++ b/make-setup-generated.sh
> @@ -1,39 +1,61 @@
>  #! /bin/sh
> +#
> +# Generate version and metadata preamble for the document
> +#
>  
> -VERSION=1.1
> -DATESTR=${DATESTR:-`cat REVISION-DATE 2>/dev/null`}
> -if [ x"$DATESTR" = x ]; then
> -    ISODATE=`git show --format=format:'%cd' --date=iso | head -n 1`
> -    DATESTR=`date -d "$DATE" +'%d %B %Y'`
> +# Currently this works of the closest lightweight tag but we can
> +# update this when we start using proper signed and annotated tags.
> +TAG=$(git describe 2> /dev/null)
> +if [ x"$TAG" = x ]; then
> +    # no tag on head
> +    TAG=$(git describe --dirty --tags)
> +    # base date on now
> +    DATESTR=$(date +'%d %B %Y')
> +    COMMIT=$(git rev-parse --short HEAD)
> +else
> +    # base date on tag
> +    DATESTR=$(git log HEAD^..HEAD --format=format:"%cd" --date=format:"%d %B %Y")
> +    COMMIT=""
> +fi
> +
> +VERSION=$(cut -d'-' -f2 <<EOF
> +$TAG
> +EOF
> +       )
> +
> +# Finally check if we have un-committed changes in the tree
> +if git diff-index --quiet HEAD -- ; then
> +    COMMIT="$COMMIT with local changes"
> +fi
> +
> +if [ x"$COMMIT" = x ]; then
> +    WORKINGDRAFT=""
> +else
> +    WORKINGDRAFT=" (@ git $COMMIT)"
>  fi
>  
>  case "$1" in
>      *-wd*)
>  	STAGE=wd
>  	STAGENAME="Working Draft"
> -	WORKINGDRAFT=`basename "$1" | sed 's/.*-wd//'`
>  	;;
>      *-os*)
>  	STAGE=os
>  	STAGENAME="OASIS Standard"
> -	WORKINGDRAFT=""
>  	;;
>      *-csd*)
>  	STAGE=csd
> -	WORKINGDRAFT=`basename "$1" | sed 's/.*-csd//'`
> -	STAGENAME="Committee Specification Draft $WORKINGDRAFT"
> +	STAGENAME="Committee Specification Draft$WORKINGDRAFT"
>  	;;
>      *-csprd*)
>  	STAGE=csprd
> -	WORKINGDRAFT=`basename "$1" | sed 's/.*-csprd//'`
> -	STAGENAME="Committee Specification Draft $WORKINGDRAFT"
> -	STAGEEXTRATITLE=" / \newline Public Review Draft $WORKINGDRAFT"
> -	STAGEEXTRA=" / Public Review Draft $WORKINGDRAFT"
> +	STAGENAME="Committee Specification Draft$WORKINGDRAFT"
> +	STAGEEXTRATITLE=" / \newline Public Review Draft$WORKINGDRAFT"
> +	STAGEEXTRA=" / Public Review Draft$WORKINGDRAFT"
>  	;;
>      *-cs*)
>  	STAGE=cs
> -	WORKINGDRAFT=`basename "$1" | sed 's/.*-cs//'`
> -	STAGENAME="Committee Specification $WORKINGDRAFT"
> +	STAGENAME="Committee Specification$WORKINGDRAFT"
>  	;;
>      *)
>  	echo Unknown doc type >&2
> @@ -54,7 +76,7 @@ cat > setup-generated.tex <<EOF
>  % define VIRTIO Working Draft number and date
>  \newcommand{\virtiorev}{$VERSION}
>  \newcommand{\virtioworkingdraftdate}{$DATESTR}
> -\newcommand{\virtioworkingdraft}{$WORKINGDRAFT}
> +\newcommand{\virtioworkingdraft}{$COMMIT}
>  \newcommand{\virtiodraftstage}{$STAGE}
>  \newcommand{\virtiodraftstageextra}{$STAGEEXTRA}
>  \newcommand{\virtiodraftstageextratitle}{$STAGEEXTRATITLE}
> diff --git a/makeall.sh b/makeall.sh
> index 37e6c34..1e25b82 100755
> --- a/makeall.sh
> +++ b/makeall.sh
> @@ -1,7 +1,6 @@
>  #!/bin/sh
>  
>  export SPECDOC=${SPECDOC:-`cat REVISION`}
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  ./makezip.sh
>  ./makehtml.sh
>  ./makepdf.sh
> diff --git a/makediff.sh b/makediff.sh
> index ef538c5..03f6731 100755
> --- a/makediff.sh
> +++ b/makediff.sh
> @@ -1,7 +1,6 @@
>  #force revision and date in environment
>  #this way they don't appear in the diff
>  export SPECDOC=${SPECDOC:-`cat REVISION`}
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  export FROMVERSION=${FROMVERSION:-`cat DIFFVERSION`}
>  
>  #make pdf diff using latexpand and latexdiff-fast
> diff --git a/makediffall.sh b/makediffall.sh
> index caff23e..f1a3333 100755
> --- a/makediffall.sh
> +++ b/makediffall.sh
> @@ -1,5 +1,4 @@
>  export SPECDOC=${SPECDOC:-`cat REVISION`}
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  export FROMVERSION=${FROMVERSION:-`cat DIFFVERSION`}
>  ./makezip.sh
>  mv -f $SPECDOC.zip $SPECDOC-diff-from-${FROMVERSION}.pdf
> diff --git a/makediffwithbase.sh b/makediffwithbase.sh
> index 8cd3c7a..3916c83 100755
> --- a/makediffwithbase.sh
> +++ b/makediffwithbase.sh
> @@ -1,5 +1,4 @@
>  export SPECDOC=${SPECDOC:-`cat REVISION`}
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  ./makezip.sh
>  ./makehtml.sh
>  ./makepdf.sh
> diff --git a/maketex.sh b/maketex.sh
> index c3b458f..1fee32b 100755
> --- a/maketex.sh
> +++ b/maketex.sh
> @@ -1,3 +1,2 @@
>  export SPECDOC=${SPECDOC:-`cat REVISION`}-tex
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  ./makezip.sh
> diff --git a/makezip.sh b/makezip.sh
> index 806fa52..40b13cc 100755
> --- a/makezip.sh
> +++ b/makezip.sh
> @@ -1,5 +1,4 @@
>  export SPECDOC=${SPECDOC:-`cat REVISION`}
> -export DATESTR=${DATESTR:-`cat REVISION-DATE`}
>  rm -f $SPECDOC.zip
>  if test -d .git; then
>  	git archive --format=zip --prefix=tex/ -o $SPECDOC.zip HEAD
> @@ -15,6 +14,5 @@ zip $SPECDOC.zip listings/virtio_queue.h
>  rm -fr tmpfilesforzip
>  mkdir -p tmpfilesforzip/tex
>  echo "$SPECDOC" > tmpfilesforzip/tex/REVISION
> -echo "$DATESTR" > tmpfilesforzip/tex/REVISION-DATE
>  cd tmpfilesforzip
>  zip ../$SPECDOC.zip tex/*
> -- 
> 2.20.1
> 
> 
> This publicly archived list offers a means to provide input to the
> OASIS Virtual I/O Device (VIRTIO) TC.
> 
> In order to verify user consent to the Feedback License terms and
> to minimize spam in the list archive, subscription is required
> before posting.
> 
> Subscribe: virtio-comment-subscribe@lists.oasis-open.org
> Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
> List help: virtio-comment-help@lists.oasis-open.org
> List archive: https://lists.oasis-open.org/archives/virtio-comment/
> Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
> List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
> Committee: https://www.oasis-open.org/committees/virtio/
> Join OASIS: https://www.oasis-open.org/join/

----- End forwarded message -----


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


  reply	other threads:[~2020-04-30  7:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 10:37 [virtio-comment] [RFC PATCH 0/8] some tweaks to the document build process Alex Bennée
2020-03-27 10:37 ` [virtio-comment] [RFC PATCH 1/8] README.md: convert html to proper Markdown format Alex Bennée
2020-04-30  7:39   ` [virtio-comment] Re: [virtio-dev] " Michael S. Tsirkin
2020-03-27 10:37 ` [virtio-comment] [RFC PATCH 2/8] CONTRIBUTING.md: convert to proper MarkDown Alex Bennée
2020-03-27 10:37 ` [virtio-comment] [RFC PATCH 3/8] LICENSE.md: convert html " Alex Bennée
2020-03-27 10:37 ` [virtio-comment] [RFC PATCH 4/8] makeall.sh: add explicit shebang to script Alex Bennée
2020-03-27 10:47   ` Cornelia Huck
2020-03-27 10:38 ` [virtio-comment] [RFC PATCH 5/8] Cleanup old changelog files Alex Bennée
2020-03-27 10:38 ` [virtio-comment] [RFC PATCH 6/8] Remove all mentioned of subversion Alex Bennée
2020-03-27 10:38 ` [virtio-comment] [RFC PATCH 7/8] make*: remove reliance on REVISION-DATE and use git Alex Bennée
2020-04-30  7:46   ` Michael S. Tsirkin [this message]
2020-03-27 10:38 ` [virtio-comment] [RFC PATCH 8/8] Makefile: add simple make automation with clean target Alex Bennée
2020-04-30  7:50   ` Michael S. Tsirkin
2020-03-27 10:53 ` [virtio-comment] [RFC PATCH 0/8] some tweaks to the document build process Cornelia Huck
2020-03-27 11:58   ` Alex Bennée
2020-04-06 11:14 ` [virtio-comment] " Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200430034518-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=virtio-comment@lists.oasis-open.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.