[petsc-dev] dates of last change on PETSc web pages

Barry Smith bsmith at mcs.anl.gov
Tue Mar 20 22:15:10 CDT 2012


On Mar 20, 2012, at 9:59 PM, Sean Farley wrote:

> I thought you had some mechanism to get the date from Mecurial and put it into the page automatically. Did you or did you not have that?
> 
> Oh, I think I see why I was confused now. I was talking about having a place holder (i.e. something like <div id="modified"></div>) in each page and that something would need to insert the output of $(hg log -l 1 --template '{date|dateiso}').

   I thought that when someone committed one of these files, as part of the commit process hg would stick the current data into that file. If that is not possible then a trigger when pushing something to the master repository with a change in the file the trigger would put the date into the file (perhaps creating another entry in the commit history at that time). 

   RCS has this support trivially and for a ton of decades.

Demo program for RCS
   // $Author: ola $
   // $Date: 1997/01/20 22:58:41 $
   // $Id: foo.cc,v 1.1 1997/01/20 22:58:41 ola Exp $


http://mercurial.selenic.com/wiki/KeywordExtension  seems to be what we should use. It appears that the hg makes sure the working copy always has the value (Date of last change in our case) in files one sees.

  Check it out.


Proving Linus thinks like Satish: 

Not sure this will ever be in Git. To quote Linus: "The whole notion of keyword substitution is just totally idiotic. It's trivial to do "outside" of the actual content tracking, if you want to have it when doing release trees as tar-balls etc."



> If I added javascript to the page then it would just get the date from a webservice ..

   No no no don't want that.

  Barry


> . which is pretty much worthless because the content wouldn't necessarily match the date.

  
> 
> Editing the pages is no biggie, Jed can give you a perl one liner to put the chunk of stuff you need added to each page.
> 
> So you want the dates stored permanently in each webpage under src/docs/website (which would alter the commit history)?




More information about the petsc-dev mailing list