Re: [Fwd: Re: Allow bootstrap from git repository]

2008-04-16 Thread Jim Meyering
Peter O'Gorman [EMAIL PROTECTED] wrote:
...
 Thanks for looking at this. I still can not push though :(

 Total 9 (delta 0), reused 0 (delta 0)
 error: Unable to append to logs/refs/heads/master: Permission denied
 ng refs/heads/master failed to write
 error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/libtool.git'

It should work better, now that files (not just directories)
are group writable.




Re: [Fwd: Re: Allow bootstrap from git repository]

2008-04-16 Thread Peter O'Gorman
Jim Meyering wrote:
 Peter O'Gorman [EMAIL PROTECTED] wrote:
 ...
 Thanks for looking at this. I still can not push though :(

 Total 9 (delta 0), reused 0 (delta 0)
 error: Unable to append to logs/refs/heads/master: Permission denied
 ng refs/heads/master failed to write
 error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/libtool.git'
 
 It should work better, now that files (not just directories)
 are group writable.

Yes, it seems to work better now.

Is there a hook that sends email to the libtool-commit list for each push?

Thank you,
Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Allow bootstrap from git repository

2008-04-15 Thread Peter O'Gorman
Ralf Wildenhues wrote:
 * Peter O'Gorman wrote on Tue, Apr 15, 2008 at 07:40:54AM CEST:
 
 Could do a count of ChangeLog* files, and use that as the first digit, I
 suppose. Not tonight though, need some sleep :)
 
 Sounds like a possible plan.

I looked again, and at first counted all the lines in all the
changelogs, but then it seemed better to count only what looked like dates.

Ok?

Peter
-- 
Peter O'Gorman
http://pogma.com
From 1faad4199ac85a135f8455a10497aa1825f8c736 Mon Sep 17 00:00:00 2001
From: Peter O'Gorman [EMAIL PROTECTED]
Date: Tue, 15 Apr 2008 09:35:38 -0500
Subject: [PATCH] Allow bootstrap from git repository.

	* Makefile.am: Pass srcdir as an argument to mkstamp and expect
	only 2 fields in mkstamps output.
	* clcommit.m4sh: Ditto.
	* configure.ac: Ditto.
	* libltdl/config/mkstamp: return a revision and date based on
	the number of lines which look like dates in all the ChangeLog*
	files in the directory we got as arg 1.
---
 ChangeLog  |   11 +++
 Makefile.am|4 ++--
 clcommit.m4sh  |2 +-
 configure.ac   |2 +-
 libltdl/config/mkstamp |   31 +--
 5 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b4fac02..97dc1d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-04-14  Peter O'Gorman  [EMAIL PROTECTED]
+
+	Allow bootstrap from git repository.
+	* Makefile.am: Pass srcdir as an argument to mkstamp and expect
+	only 2 fields in mkstamps output.
+	* clcommit.m4sh: Ditto.
+	* configure.ac: Ditto.
+	* libltdl/config/mkstamp: return a revision and date based on
+	the number of lines which look like dates in all the ChangeLog*
+	files in the directory we got as arg 1.
+
 2008-04-11  Eric Blake  [EMAIL PROTECTED]
 
 	Fix usage of setmode without declaration on cygwin.
diff --git a/Makefile.am b/Makefile.am
index 0168a41..480b647 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,9 +50,9 @@ lt__cd		= CDPATH=$${ZSH_VERSION+.}$(PATH_SEPARATOR)  cd
 
 MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp
 
-timestamp = set dummy `$(MKSTAMP)  $(srcdir)/ChangeLog`; shift; \
+timestamp = set dummy `$(MKSTAMP) $(srcdir)`; shift; \
 	case $(VERSION) in \
-	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 $$3 ;; \
+	  *[acegikmoqsuwy]) TIMESTAMP= $$1 $$2 ;; \
 	  *) TIMESTAMP= ;; \
 	esac
 
diff --git a/clcommit.m4sh b/clcommit.m4sh
index 3439dae..7fe9d2d 100644
--- a/clcommit.m4sh
+++ b/clcommit.m4sh
@@ -444,7 +444,7 @@ func_mailnotify ()
   test -f CVS/Root 
   echo CVSROOT:	`$SED -e 's,.*:,,g' CVS/Root`
   test -f $MKSTAMP 
-  echo TIMESTAMP:	`$SHELL $MKSTAMP  ./ChangeLog`
+  echo TIMESTAMP:	`$SHELL $MKSTAMP .`
   test -f CVS/Repository 
   echo Module name:	`cat CVS/Repository`
   test -f CVS/Tag 
diff --git a/configure.ac b/configure.ac
index 6f49016..4660a67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,7 +103,7 @@ AC_SUBST([LASTRELEASE])
 # This is a sanity check so we can see which version is used in bug reports.
 # It is assumed that we only want to see the date extension for cvs libtool
 # versions (i.e. odd letters) and not actual alpha releases.
-TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp  ${srcdir}/ChangeLog`
+TIMESTAMP=`${CONFIG_SHELL} ${ac_aux_dir}/mkstamp ${srcdir}`
 package_revision=`( set $TIMESTAMP; echo $1; )`
 case $lt_alpha in
   [[bdfhjlnprtvxz]])
diff --git a/libltdl/config/mkstamp b/libltdl/config/mkstamp
index 8d8e7d8..d11599a 100755
--- a/libltdl/config/mkstamp
+++ b/libltdl/config/mkstamp
@@ -23,15 +23,26 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 
-# This script expects to find a line containing both Revision and Date
-# tags, and it edits this line so that it looks like ` $rev $date'
+# This script takes a directory as an argument and generates a
+# revision and date based upon the ChangeLog files in that directory.
 
-# Command-line arguments are passed down to sed; additional -e cmd
-# arguments are acceptable.  Input is from from stdin.  The original
-# version of this script accepted input from a named file or stdin.
+# Generate a revision that looks similar to CVS revision by using 1.
+# then the number of lines in the ChangeLogs starting with dates (an
+# approximation of the number of commits) + 1000. 
+# For those pulling from the savannah git repository it should be
+# possible to go from this revision number to the git revision fairly
+# easily. The number will also always increase.
 
-tr -d \015 | sed -e '
-	s%.*\$''Revision: \([^$]*\) \$.*\$''Date: \([^$]*\) \$.*% \1 \2%
-	t end
-	d
-	: end' ${1+$@}
+awk 'BEGIN {
+	cocount=0;
+}
+/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]  / {
+if (cocount== 0) {
+datestr=$1
+}
+	cocount++;
+}
+END {
+	cocount = cocount + 1000;
+print 1. cocount   datestr;
+}' $1/ChangeLog $1/ChangeLog.*
-- 
1.5.3.7



Re: Allow bootstrap from git repository

2008-04-15 Thread Ralf Wildenhues
Hi Peter,

* Peter O'Gorman wrote on Tue, Apr 15, 2008 at 04:54:10PM CEST:
 
 I looked again, and at first counted all the lines in all the
 changelogs, but then it seemed better to count only what looked like dates.

Better.  I don't mind that multiple commits like this count as one:

2008-xx-xx  User

* foo: Foo.

* bar: Bar.


 --- a/libltdl/config/mkstamp
 +++ b/libltdl/config/mkstamp

 +awk 'BEGIN {
 + cocount=0;
 +}
 +/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]  / {
 +if (cocount== 0) {
 +datestr=$1
 +}
 + cocount++;
 +}
 +END {
 + cocount = cocount + 1000;
 +print 1. cocount   datestr;
 +}' $1/ChangeLog $1/ChangeLog.*

Please make the latter be $1/ChangeLog.[12][0-9][0-9][0-9] so backup
files don't count (I tend to cp foo foo.bak at times).  OK with that
change.

Thanks,
Ralf




Re: Allow bootstrap from git repository

2008-04-15 Thread Bob Friesenhahn
If we need an increasing serial number, can't we obtain one from git? 
Does git offer the ability to update an RCS-style string in a text 
file each time it is modified?  If that is the case, then we would 
just need to arrange to modify that file each time there is a commit 
to git.  Of course since git uses distributed repositories, this might 
become tricky.


We don't want to force someone to have to use git to do a 'make dist' 
but since git is necessary in order to submit changes, it is 
reasonable to make full use of it at that time.


Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: Allow bootstrap from git repository

2008-04-15 Thread Ralf Wildenhues
* Bob Friesenhahn wrote on Tue, Apr 15, 2008 at 08:15:45PM CEST:
 If we need an increasing serial number, can't we obtain one from git?  
 Does git offer the ability to update an RCS-style string in a text file 
 each time it is modified?  If that is the case, then we would just need 
 to arrange to modify that file each time there is a commit to git.  Of 
 course since git uses distributed repositories, this might become tricky.

 We don't want to force someone to have to use git to do a 'make dist'  
 but since git is necessary in order to submit changes, it is reasonable 
 to make full use of it at that time.

Bob, of course it is possible to do with git.  All that is needed is
  git describe

and one prior signed tag.  This is what Autoconf does, for example.

I think Peter invested the time to do this in order to allow
bootstrapping without having git available.  If you're now OK with
needing git for bootstrapping, then we can go similar to Autoconf.

Cheers,
Ralf




Re: Allow bootstrap from git repository

2008-04-15 Thread Bob Friesenhahn

On Tue, 15 Apr 2008, Ralf Wildenhues wrote:

bootstrapping without having git available.  If you're now OK with
needing git for bootstrapping, then we can go similar to Autoconf.


No, that is not ok for me. :-)

I had a different idea but now I realize that it was unworkable.

Bob
==
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/





Re: Allow bootstrap from git repository

2008-04-15 Thread Peter O'Gorman
Ralf Wildenhues wrote:

 Please make the latter be $1/ChangeLog.[12][0-9][0-9][0-9] so backup
 files don't count (I tend to cp foo foo.bak at times).  OK with that
 change.

git push fails for me with:

[EMAIL PROTECTED] libtool]$ git push
updating 'refs/heads/master'
  from 484680fe022563c93a37dad3b1bca46028b1e866
  to   3528106688e06c4be785e17966b2ad3067250fec
 Also local refs/remotes/origin/master
Generating pack...
Done counting 9 objects.
Deltifying 9 objects...
 100% (9/9) done
Writing 9 objects...
 100% (9/9) done
Total 9 (delta 0), reused 0 (delta 0)
error: Unable to append to logs/refs/heads/master: Permission denied
ng refs/heads/master failed to write
error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/libtool.git'

Since it it the first time I have ever done a 'git push', I'll assume
it's me. Help?

Peter
-- 
Peter O'Gorman
http://pogma.com




Re: Allow bootstrap from git repository

2008-04-14 Thread Ralf Wildenhues
Hi Peter,

* Peter O'Gorman wrote on Tue, Apr 15, 2008 at 05:43:36AM CEST:
 * Makefile.am: Expect mkstamp to return only rev date.
 * libltdl/config/mkstamp: return a revision and date based on the
 number of lines in the input and the topmost date.

Hmm, I was almost saying OK, except the last nit below:

 +# Generate a revision that looks similar to CVS revision by using 1.
 +# then the last 2 digits of the year +30 (so that the revision number

Two digit will *always* be enough, just like 640K!  ;-)

 +# is greater than the last cvs revision, and the number of lines
 +# in the ChangeLog. For those pulling from the savannah git repository
 +# it should be possible to go from this revision number to the git
 +# revision fairly easily. The number will also always increase,e ven

s/e ven/ even/

 +# when we rotate ChangeLogs in the new year.

But how do you ensure @MACRO_SERIAL@ increases after ChangeLog rotation?

 +awk 'BEGIN {
 + dated=0;
 +}
 +/^20/ {
 + if (dated == 0) {
 + dated=1;
 + datestr=$1;
 + }
 +}
 +END {
 + yr=substr(datestr,3,2) + 30;
 + print 1. yr NR   datestr;
 +}'




Re: Allow bootstrap from git repository

2008-04-14 Thread Ralf Wildenhues
* Peter O'Gorman wrote on Tue, Apr 15, 2008 at 07:40:54AM CEST:
 Ralf Wildenhues wrote:
 
  But how do you ensure @MACRO_SERIAL@ increases after ChangeLog rotation?
 
 Ha! Having never done a ChangeLog rotation or paid it much attention, I
 figured that the new ChangeLog would have a commit message like usual.
 
 2009-01-01  Ralf
 
   Rotate Changelogs.
   * ChangeLog, ChangeLog.2007: rotated.
 
 But they don't :)

That would be easy to solve.  But even if they did, the macro serial
goes from 38763 or so to 3910, not from 1.38763 to 1.3910.

 Could do a count of ChangeLog* files, and use that as the first digit, I
 suppose. Not tonight though, need some sleep :)

Sounds like a possible plan.

Cheers,
Ralf