From: Ian Campbell Subject: Re: [PATCH v2] Use {git, hg, svn} commit id if available for xen_changeset Date: Wed, 8 May 2013 13:05:28 +0100 Message-ID: <1368014728.26321.258.camel@zakaz.uk.xensource.com> References: <20130508054520.92032336@duch.mimuw.edu.pl> <1368011157.26321.233.camel@zakaz.uk.xensource.com> <518A3463.2080602@citrix.com> <1368012397.26321.243.camel@zakaz.uk.xensource.com> <518A3E31.2000501@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <518A3E31.2000501@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Sander Eikelenboom , "Keir (Xen.org)" , Marek Marczykowski , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-05-08 at 12:59 +0100, Andrew Cooper wrote: > On 08/05/13 12:26, Ian Campbell wrote: > > On Wed, 2013-05-08 at 12:17 +0100, Andrew Cooper wrote: > >> On 08/05/13 12:05, Ian Campbell wrote: > >>> On Wed, 2013-05-08 at 06:42 +0100, Marek Marczykowski wrote: > >>>> As Xen uses git as primary repository, get git commit id for > >>>> xen_changeset info. > >>> I applied this to an hg repo and: > >>> $ chmod +x xen/tools/scmversion > >>> $ rm xen/include/xen/compile.h > >>> $ make -C xen include/xen/compile.h > >>> make: Entering directory `/local/scratch/ianc/devel/xen-unstable.hg/xen' > >>> __ __ _ _ _____ _ _ _ > >>> \ \/ /___ _ __ | || | |___ / _ _ _ __ ___| |_ __ _| |__ | | ___ > >>> \ // _ \ '_ \ | || |_ |_ \ __| | | | '_ \/ __| __/ _` | '_ \| |/ _ \ > >>> / \ __/ | | | |__ _| ___) |__| |_| | | | \__ \ || (_| | |_) | | __/ > >>> /_/\_\___|_| |_| |_|(_)____/ \__,_|_| |_|___/\__\__,_|_.__/|_|\___| > >>> > >>> make: Leaving directory `/local/scratch/ianc/devel/xen-unstable.hg/xen' > >>> $ grep CHANGESET xen/include/xen/compile.h > >>> #define XEN_CHANGESET " 2>/dev/null | tr -d n)" > >>> > >>> Same seems to happen for a git repo too so its not VCS specific. > >>> > >>> It also happens if I do an actual build rather than forcing things as > >>> above. > >>> > >>> Running scmversion by hand appears to produce good output. > >>> > >>> Indentation in svmversion seems a bit off though, e.g. > >>> + printf '%s %s%s' "$date" git: $head > >>> + > >>> + # Is this git on svn? > >>> + if git config --get svn-remote.svn.url >/dev/null; then > >>> + printf -- 'svn:%s' "`git svn find-rev $head`" > >>> + fi > >>> > >>> Seems to be tab vs space related, the printf is space indented and the > >>> rest is tab indented. > >>> > >>> Ian. > >> Can I please re-request a merge of this change (which in itself is good > >> and fine) with > >> > >> http://lists.xen.org/archives/html/xen-devel/2012-07/msg01886.html > > I see that Ian J had a comment, was that addressed? > > It was addressed in so far as I stated that it didn't get executed > multiple times. The archives seem to have broken the thread of > conversation, which had an extra back-and-forth on it. I see it now, the archives break threads over month boundaries :-( > > > >> The reason is that the changeset information is *still broken* for an > >> out-of-scm builds such as RPMs and DEBs. > >> > >> I will happily rebase the above path on top of this one, if it is accepted. > > This patch includes handling of a ".scmversion" file in the tarball. > > I've no idea how to make git archive generate that but perhaps it would > > be possible for it to be created as part of our tarball generation > > process (Ian J CCd) and/or by RPM/DEB packaging. > > > > I did think git archive automatically added a .gitarchive file to the > > output, but my version doesn't seem to do that. > > > > If you want to address Ian's concern and rebase that may still be > > worthwhile. > > > > Ian. > > > > A sample .hg_archival.txt is: > > repo: 6ed20573be52baab95207f52a8d28084f3a1967c > node: 3a180a46d747dddf77e9bc987f216aaeb84adea7 > branch: default > latesttag: v2.3.0 > latesttagdistance: 45 > > Which is sadly not enough to recreate the : changeset > string for HG. > > > For the background of this patch, XenServer uses a patchqueue. I have > specifically listed the base and pq versions separately, as the > changeset information for an `hg archive` of a base repo with a pushed > queue is functionally useless after either of the base or patch queue > gets changed. With Marek's patch you could write .scmversion into the build tree at whichever point you would normally override the XEN_CHANGESET variable. Not that I object to also being able to override the variable. Ian.