OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [mst@redhat.com: Re: [virtio-comment] [RFC PATCH 7/8] make*: remove reliance on REVISION-DATE and use git]


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 -----



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]