Git development
 help / color / mirror / Atom feed
* [PATCH] cg-export to tarball
From: Joshua T. Corbin @ 2005-04-26  7:12 UTC (permalink / raw)
  To: git

The following patch to cg-export will simlpy create a tarball if the argument 
ends in .tar.gz, .tar.bz2, or .tar.

Signed-off-by; Joshua T. Corbin <jcorbin@wunjo.org>

Index: cg-export
===================================================================
--- c7eec90959408a71c465b36e728113a2754f99df/cg-export  (mode:100755 
sha1:94d419de48a12f1ea1059451ac4cd489f7008916)
+++ b839b802f91e79ea7b0bb7dcf3e228659bf96a87/cg-export  (mode:100755 
sha1:29834b2749b0a8d7c71a4c67325e4f5ece9d28a0)
@@ -24,8 +24,33 @@
 
 [ -e "$destdir" ] && die "$destdir already exists."
 
+case $destdir in
+  *.tar*)
+    tarfile=$destdir
+    destdir=${destdir%.tar*}
+    ;;
+esac
+
 mkdir -p $destdir || die "cannot create $destdir"
 export GIT_INDEX_FILE="$destdir/.git-index"
 read-tree $id
 checkout-cache "--prefix=$destdir/" -a
 rm $GIT_INDEX_FILE
+
+[ -z "$tarfile" ] && exit 0
+
+case $tarfile in
+  *.tar.gz)
+    tar -cvzf $tarfile $destdir || die "Failed to create $tarfile"
+    ;;
+  *.tar.bz2)
+    tar -cvjf $tarfile $destdir || die "Failed to create $tarfile"
+    ;;
+  *.tar)
+    tar -cvf $tarfile $destdir || die "Failed to create $tarfile"
+    ;;
+  *)
+    die "Don't know how to make a ${tarfile#$destdir} file"
+    ;;
+esac
+rm -fr $destdir

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Philip Pokorny @ 2005-04-26  7:02 UTC (permalink / raw)
  To: pasky, git; +Cc: linux-kernel
In-Reply-To: <20050426032422.GQ13467@pasky.ji.cz>

Petr Baudis wrote:

> the history changed again (hopefully the
>last time?) because of fixing dates of some old commits.
>

Looks like the git-pasky-0.7 tags (and friends) are now dead links. For 
example:

[philip@xray cogito]$ cg-mkpatch git-pasky-0.7:HEAD
.git/objects/c8/3b95297c2a6336c2007548f909769e0862b509: No such file or 
directory
fatal: cat-file c83b95297c2a6336c2007548f909769e0862b509: bad file
Invalid id: c83b95297c2a6336c2007548f909769e0862b509


Is there any way to recover that, or has the timeline been irrevocably 
altered, and we're all now doomed to meet bastard daughters of long dead 
crew members? [grin]...

:v)

Actually, I really liked that Enterprise-C episode...

^ permalink raw reply

* Re: git add / update-cache --add fails.
From: Rhys Hardwick @ 2005-04-26  6:26 UTC (permalink / raw)
  To: git
In-Reply-To: <Pine.LNX.4.58.0504251741430.18901@ppc970.osdl.org>

That may be true!  I changed to linux full time only about 8 months ago, but 
haven't looked back.

Ok strace gave me:

=====

rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
execve("/home/rhys/bin/update-cache", ["update-cache", "--add", "w1d4p1.c"], 
[/*
 37 vars */]) = 0
uname({sys="Linux", node="metatron", ...}) = 0
brk(0)                                  = 0x8050000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0
xb7fe9000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78204, ...}) = 0
old_mmap(NULL, 78204, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd5000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/usr/lib/libz.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\27"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=67468, ...}) = 0
old_mmap(NULL, 70528, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7fc3000
old_mmap(0xb7fd4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x100
00) = 0xb7fd4000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/usr/lib/i686/cmov/libssl.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\205\0"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=198576, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0
xb7fc2000
old_mmap(NULL, 199344, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f91000
old_mmap(0xb7fbf000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x2e
000) = 0xb7fbf000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`Z\1\000"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1254468, ...}) = 0
old_mmap(NULL, 1264780, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7e5c000
old_mmap(0xb7f86000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x12
9000) = 0xb7f86000
old_mmap(0xb7f8f000, 7308, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONY
MOUS, -1, 0) = 0xb7f8f000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/usr/lib/i686/cmov/libcrypto.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\300\2"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1029672, ...}) = 0
old_mmap(NULL, 1043608, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5d000
old_mmap(0xb7e47000, 73728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0xea
000) = 0xb7e47000
old_mmap(0xb7e59000, 11416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANON
YMOUS, -1, 0) = 0xb7e59000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or 
directory)
open("/lib/tls/libdl.so.2", O_RDONLY)   = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\32"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9872, ...}) = 0
old_mmap(NULL, 8632, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5a000
old_mmap(0xb7d5c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 
0x200
0) = 0xb7d5c000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7d59000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7d592a0, limit:1048575, 
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, 
seg_not_present:0, useable:1}) = 0
munmap(0xb7fd5000, 78204)               = 0
open(".git/index.lock", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
access(".git/objects", X_OK)            = 0
open(".git/index", O_RDONLY)            = 4
fstat64(4, {st_mode=S_IFREG|0600, st_size=176, ...}) = 0
mmap2(NULL, 176, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7fe8000
close(4)                                = 0
brk(0)                                  = 0x8050000
brk(0x8071000)                          = 0x8071000
brk(0)                                  = 0x8071000
open("w1d4p1.c", O_RDONLY)              = -1 ENOENT (No such file or 
directory)
write(2, "fatal: ", 7fatal: )                  = 7
write(2, "Unable to add w1d4p1.c to databa"..., 34Unable to add w1d4p1.c to 
database) = 34
write(2, "\n", 1
)                       = 1
unlink(".git/index.lock")               = 0
exit_group(1)                           = ?

====

ltrace update-cache --add xxxx gave

====

rhys@metatron:~/repo/learning.repo$ ltrace update-cache --add w1d4p1.c
__libc_start_main(0x8049680, 3, 0xbffff854, 0x804ad60, 0x804adc0 
<unfinished ...>
getenv("GIT_INDEX_FILE")                                                = NULL
snprintf(".git/index.lock", 4097, "%s.lock", ".git/index")              = 15
open(".git/index.lock", 194, 0600)                                      = 3
__cxa_atexit(0x8049660, 0, 0, 0xb7f8de80, 0xbffff7c8)                   = 0
__errno_location()                                                      = 
0xb7d59280
getenv("SHA1_FILE_DIRECTORY")                                           = NULL
access(".git/objects", 1)                                               = 0
getenv("GIT_INDEX_FILE")                                                = NULL
open(".git/index", 0, 026777021220)                                     = 4
__fxstat(3, 4, 0xbffff710)                                              = 0
__errno_location()                                                      = 
0xb7d59280
mmap(0, 176, 1, 2, 4)                                                   = 
0xb7fe8000
close(4)                                                                = 0
SHA1_Init(0xbffff660, 0xb7e67bc8, 0xb7fc2290, 0x804870e, 96)            = 1
SHA1_Update(0xbffff660, 0xb7fe8000, 156, 0x804870e, 96)                 = 1
SHA1_Final(0xbffff640, 0xbffff660, 156, 0x804870e, 96)                  = 1
calloc(27, 4)                                                           = 
0x8050008
open("w1d4p1.c", 0, 044653)                                             = -1
__errno_location()                                                      = 
0xb7d59280
fputs("fatal: ", 0xb7f86f60fatal: )                                            
= 1
vfprintf(0xb7f86f60, "Unable to add %s to database", 0xbffff794Unable to add 
w1d4p1.c to database)        = 34
fputc('\n', 0xb7f86f60
)                                                 = 10
exit(1 <unfinished ...>
unlink(".git/index.lock")                                               = 0
+++ exited (status 1) +++

====

More information:  this seems to be happening with all my local repositories.  
I can remove files from the cache, and commit fine, but not add files.


Rhys

On Tuesday 26 Apr 2005 01:47, Linus Torvalds wrote:



^ permalink raw reply

* [PATCH] Don't use commit-id in building
From: Daniel Barkalow @ 2005-04-26  6:03 UTC (permalink / raw)
  To: Al Viro; +Cc: Jeff Garzik, pasky, git, linux-kernel
In-Reply-To: <20050426054017.GS13052@parcelfarce.linux.theplanet.co.uk>

On Tue, 26 Apr 2005, Al Viro wrote:

> > > So, it still complains about commit-id
> > 
> > In this case, it would complain about .git/HEAD even if it found
> > commit-id. The right solution is probably to suppress that part if there's
> > no .git/HEAD.
> 
> The right thing is to stop assuming that everyone has . in their $PATH,
> to start with...

Does anyone have . in their $PATH? I've only used the commit-id that I
installed previously. Since the tarball doesn't have a .git directory, the
only way you end up building cogito from a directory with a repository is
by using an earlier cogito or something of the sort, in which case, you
probably have the program.

In any case, commit-id isn't actually necessary for this operation.

-
We don't necessarily have commit-id available when building. Furthermore,
we don't necessarily have a repository. Just put in .git/HEAD if it
exists; otherwise, it's a base distribution.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>

Index: Makefile
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/Makefile  (mode:100644 sha1:4f01bbbbb3fd0e53e9ce968f167b6dae68fcfa92)
+++ uncommitted/Makefile  (mode:100644)
@@ -87,11 +87,13 @@
 http-pull: LIBS += -lcurl
 
 
-cg-version: $(VERSION)
+cg-version: $(VERSION) .git/HEAD
 	@echo Generating cg-version...
 	@rm -f $@
 	@echo "#!/bin/sh" > $@
-	@PATH=.:$(PATH) echo "echo \"$(shell cat $(VERSION)) ($(shell commit-id))\"" >> $@
+	@echo -n "echo \"$(shell cat $(VERSION))" >> $@
+	@if [ -r .git/HEAD ]; then echo -n " ($(shell cat .git/HEAD))" >> $@; fi
+	@echo "\"" >> $@
 	@chmod +x $@
 
 install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)


^ permalink raw reply

* Re: git "tag" objects implemented - and a re-done commit
From: Ryan Anderson @ 2005-04-26  5:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andreas Gal, Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0504251530480.18901@ppc970.osdl.org>

On Mon, 2005-04-25 at 15:39 -0700, Linus Torvalds wrote:
> 
> On Mon, 25 Apr 2005, Linus Torvalds wrote:
> > 
> > So I'll probably just push out my tags with my archives, and then people
> > can verify them if they want to.
> 
> Ok, for the intrepid users, you can now test to see if you can pick them 
> out. fsck should make them totally obvious, and here's my public key in 
> case you also want to verify the things.
> 
> Of course, since I normally don't use pgp signing etc, it's entirely 
> possible that I've done something stupid, and I'm now sending you my 
> secret key and my full porn-collection.

(Un?)fortunately, you appear to have done it correctly.

Now, you just need to get a few people that know for certain it's really
your key to sign it and upload the signatures to the key server, and it
would be golden.

-- 
Ryan Anderson <ryan@michonline.com>

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Al Viro @ 2005-04-26  5:40 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: Jeff Garzik, pasky, git, linux-kernel
In-Reply-To: <Pine.LNX.4.21.0504260103050.30848-100000@iabervon.org>

> > So, it still complains about commit-id
> 
> In this case, it would complain about .git/HEAD even if it found
> commit-id. The right solution is probably to suppress that part if there's
> no .git/HEAD.

The right thing is to stop assuming that everyone has . in their $PATH,
to start with...

^ permalink raw reply

* [PATCH] cogito debian dir
From: Joshua T. Corbin @ 2005-04-26  5:23 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

Debianization of cogito 0.8.0, binary .deb can be downloaded from:
  http://node1.wunjo.org/~jcorbin/

Signed-off-by: Joshua T. Corbin <jcorbin@wunjo.org>

[-- Attachment #2: debian.diff --]
[-- Type: text/x-diff, Size: 23543 bytes --]

Index: debian/changelog
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/changelog  (mode:100644 sha1:eb7d7cd33770142fc98209c8d277aed277f01842)
@@ -0,0 +1,6 @@
+cogito (0.8.0-1) unstable; urgency=low
+
+  * Initial debianization of cogito.
+
+ -- Joshua T. Corbin <jcorbin@wunjo.org>  Tue, 26 Apr 2005 00:58:03 -0400
+
Index: debian/compat
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/compat  (mode:100644 sha1:b8626c4cff2849624fb67f87cd0ad72b163671ad)
@@ -0,0 +1 @@
+4
Index: debian/control
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/control  (mode:100644 sha1:9b1dd6033948758f3951faf48aeb8944a2c2cd2a)
@@ -0,0 +1,16 @@
+Source: cogito
+Section: admin
+Priority: optional
+Maintainer: Joshua T. Corbin <jcorbin@wunjo.org>
+Build-Depends: debhelper (>= 4.0.0)
+Standards-Version: 3.6.1
+
+Package: cogito
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Cogito - SCM layer on top of GIT.
+ The GIT itself is merely an extremely fast and flexible filesystem-based
+ database designed to store directory trees with regard to their history.
+ The top layer is a SCM-like tool Cogito which enables human beings to work
+ with the database in a manner to a degree similar to other SCM tools (like
+ CVS, BitKeeper or Monotone).
Index: debian/copyright
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/copyright  (mode:100644 sha1:766c9010804454a0d31e146dc1d5d1376f885512)
@@ -0,0 +1,367 @@
+This package was debianized by Joshua T. Corbin <jcorbin@wunjo.org> on
+Fri, 22 Apr 2005 00:17:03 -0400.
+
+It was downloaded from ftp://ftp.kernel.org/pub/software/scm/cogito/
+
+License:
+
+ Note that the only valid version of the GPL as far as this project
+ is concerned is _this_ particular version of the license (ie v2, not
+ v2.2 or v3.x or whatever), unless explicitly otherwise stated.
+
+ HOWEVER, in order to allow a migration to GPLv3 if that seems like
+ a good idea, I also ask that people involved with the project make
+ their preferences known. In particular, if you trust me to make that
+ decision, you might note so in your copyright message, ie something
+ like
+
+	This file is licensed under the GPL v2, or a later version
+	at the discretion of Linus.
+
+  might avoid issues. But we can also just decide to synchronize and
+  contact all copyright holders on record if/when the occasion arises.
+
+			Linus Torvalds
+
+----------------------------------------
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+\f
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: debian/dirs
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/dirs  (mode:100644 sha1:ca882bbb78588982a650ff2685c36fe51ae99ae3)
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
Index: debian/docs
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/docs  (mode:100644 sha1:a812d6a284645c2c117a945bbf4a8ef7a3072576)
@@ -0,0 +1,3 @@
+README
+README.reference
+COPYING
Index: debian/files
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/files  (mode:100644 sha1:ef35eaaa9f498526f7c7943d8ae370fc4a869bc0)
@@ -0,0 +1 @@
+cogito_0.8.0-1_i386.deb admin optional
Index: debian/rules
===================================================================
--- /dev/null  (tree:bb131a04832677b22959ffe47f68900b94accc0c)
+++ cd5a247980cb6eb0b42a1597f95f0c0ca1fafa2c/debian/rules  (mode:100755 sha1:8f0b639a966218f38b6f856fc2678145fe4eac70)
@@ -0,0 +1,64 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure:
+
+build: build-stamp
+
+build-stamp:
+	dh_testdir
+
+	$(MAKE)
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	-$(MAKE) clean
+
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/cogito prefix='/usr'
+	install -m755 -d $(CURDIR)/debian/cogito/usr/share/doc/cogito/contrib
+	install $(CURDIR)/contrib/* $(CURDIR)/debian/cogito/usr/share/doc/cogito/contrib
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs 
+	dh_installdocs
+	dh_installexamples
+#	dh_install
+#	dh_installmenu
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-arch
+.PHONY: build clean binary-arch binary install

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Daniel Barkalow @ 2005-04-26  5:18 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: pasky, git, linux-kernel
In-Reply-To: <426DCA75.901@pobox.com>

On Tue, 26 Apr 2005, Jeff Garzik wrote:

> tar xvfj $x
> cd x
> make
> ...
> gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o rpull rpull.c 
> libgit.a rsh.c -lz -lssl
> gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o rev-list rev-list.c 
> libgit.a -lz -lssl
> gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o git-mktag 
> git-mktag.c libgit.a -lz -lssl
> gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o diff-tree-helper 
> diff-tree-helper.c libgit.a -lz -lssl
> make: commit-id: Command not found
> Generating cg-version...
> 
> So, it still complains about commit-id

In this case, it would complain about .git/HEAD even if it found
commit-id. The right solution is probably to suppress that part if there's
no .git/HEAD.

	-Daniel
*This .sig left intentionally blank*


^ permalink raw reply

* Re: [PATCH] cogito recursive cg-add and cg-rm
From: Joshua T. Corbin @ 2005-04-26  5:17 UTC (permalink / raw)
  To: git
In-Reply-To: <200504260027.03451.jcorbin@wunjo.org>

Small one line fix on top of the previos patch, apparently I was too hasty and 
didn't test cg-rm on a single file ;)

Signed-off-by: Joshua T. Corbin <jcorbin@wunjo.org>

Index: cg-rm
===================================================================
--- bb131a04832677b22959ffe47f68900b94accc0c/cg-rm  (mode:100755 
sha1:f2d2e0c042fdf9496d53e833a50d960331e145b4)
+++ 5b396356f2c852f95a4226e955e186f46851a1f0/cg-rm  (mode:100755 
sha1:7701a83878c1e02dbce3abc0e3f1290c56c1be16)
@@ -40,7 +40,7 @@
     shift
   done > $RMFILE
   rm -f $(cat $RMFILE)
-  rmdir $(find $RMDIRS -depth -type d)
+  [ -n "$RMDIRS" ] && rmdir $(find $RMDIRS -depth -type d)
   update-cache --remove -- $(cat $RMFILE)
   rm -f $RMFILE
 else

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Jeff Garzik @ 2005-04-26  4:58 UTC (permalink / raw)
  To: pasky, git; +Cc: linux-kernel
In-Reply-To: <20050426032422.GQ13467@pasky.ji.cz>

Petr Baudis wrote:
>   Hello,
> 
>   here goes Cogito-0.8, my SCMish layer over Linus Torvald's git tree
> history tracker. This package was formerly called git-pasky, however
> this release brings big changes. The usage is significantly different,
> as well as some basic concepts; the history changed again (hopefully the
> last time?) because of fixing dates of some old commits. The .git/
> directory layout changed too.

tar xvfj $x
cd x
make
...
gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o rpull rpull.c 
libgit.a rsh.c -lz -lssl
gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o rev-list rev-list.c 
libgit.a -lz -lssl
gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o git-mktag 
git-mktag.c libgit.a -lz -lssl
gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o diff-tree-helper 
diff-tree-helper.c libgit.a -lz -lssl
make: commit-id: Command not found
Generating cg-version...



So, it still complains about commit-id

	Jeff



^ permalink raw reply

* [PATCH] cogito - split out cg-X* to prefix/lib/cogito
From: Joshua T. Corbin @ 2005-04-26  4:53 UTC (permalink / raw)
  To: git

The following patch does the following:
  * Change the Makefile to install all cg-X* to $(prefix)/lib/cogito
  * Modify all cg-* to use this lib prefix.

Basically the cg-* script looks at $0, if it appears to be in a prefix/bin 
directory that also has a prefix/lib/cogito directory, look for the cg-X* 
there; otherwise things will work as in old.

Signed-off-by: Joshua T. Corbin <jcorbin@wunjo.org>

Index: Makefile
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/Makefile  (mode:100644 
sha1:4f01bbbbb3fd0e53e9ce968f167b6dae68fcfa92)
+++ bb131a04832677b22959ffe47f68900b94accc0c/Makefile  (mode:100644 
sha1:615ccd429dc7f90820442165c64b5d9c047bccbb)
@@ -21,6 +21,7 @@
 prefix=$(HOME)
 
 bindir=$(prefix)/bin
+libdir=$(prefix)/lib/cogito
 
 CC=gcc
 AR=ar
@@ -33,11 +34,12 @@
  diff-cache convert-cache http-pull rpush rpull rev-list git-mktag \
  diff-tree-helper
 
-SCRIPT= commit-id tree-id parent-id cg-Xdiffdo cg-Xmergefile \
- cg-add cg-admin-lsobj cg-cancel cg-clone cg-commit cg-diff \
- cg-export cg-help cg-init cg-log cg-ls cg-merge cg-mkpatch \
- cg-patch cg-pull cg-branch-add cg-branch-ls cg-rm cg-seek cg-status \
- cg-tag cg-update cg-Xlib
+SCRIPT= commit-id tree-id parent-id cg-add cg-admin-lsobj cg-cancel \
+ cg-clone cg-commit cg-diff cg-export cg-help cg-init cg-log cg-ls \
+ cg-merge cg-mkpatch cg-patch cg-pull cg-branch-add cg-branch-ls \
+ cg-rm cg-seek cg-status cg-tag cg-update
+
+SCRIPTLIB= cg-Xlib cg-Xdiffdo cg-Xmergefile
 
 COMMON= read-cache.o
 
@@ -96,7 +98,9 @@
 
 install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)
 	install -m755 -d $(DESTDIR)$(bindir)
+	install -m755 -d $(DESTDIR)$(libdir)
 	install $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT) $(DESTDIR)$(bindir)
+	install $(SCRIPTLIB) $(DESTDIR)$(libdir)
 
 clean:
 	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(GEN_SCRIPT) $(LIB_FILE)
Index: cg-Xdiffdo
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-Xdiffdo  (mode:100755 
sha1:e3907b39ea105acb2f2ac3659f16898604b72d09)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-Xdiffdo  (mode:100755 
sha1:832fd2c2a09274b5279327e1c31b99afc04fa7f1)
@@ -12,7 +12,16 @@
 #
 # Outputs a diff converting the first tree to the second one.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 
 id1=$1; shift
Index: cg-Xmergefile
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-Xmergefile  (mode:100755 
sha1:0109e0ff4572be5c8f123f9df573b56a42718a17)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-Xmergefile  (mode:100755 
sha1:b074685a23b33e42ec29734984f586b18e5f30de)
@@ -21,7 +21,16 @@
 # do any merges that migth change the tree layout
 #
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 # if the directory is newly added in a branch, it might not exist
 # in the current tree
Index: cg-add
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-add  (mode:100755 
sha1:1b7a821fd0b3f9702508503a082869ed4ec3ab52)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-add  (mode:100755 
sha1:034c164fefc6f61ab386f49b5d5bf63005ea0e77)
@@ -8,7 +8,16 @@
 # Optional "-n" parameter specifies that you don't want to add directories
 # recursively.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 [ "$1" ] || die "usage: cg-add [-n] FILE..."
 
Index: cg-admin-lsobj
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-admin-lsobj  (mode:100755 
sha1:c68d9176d843700df17b109389102ae84eab3888)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-admin-lsobj  (mode:100755 
sha1:95256f36dff108274cbdaff9c97eabc2976ae00e)
@@ -16,7 +16,16 @@
 #
 # Takes the object type as the first parameter, defaults to all objects.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 target=$1
 
Index: cg-branch-add
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-branch-add  (mode:100755 
sha1:7ae72b5e920a7977641dfca8f02dda21a730b907)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-branch-add  (mode:100755 
sha1:6b42c80b8102b42a0f391ca0b39746e6ef4fb167)
@@ -26,7 +26,16 @@
 #
 # Takes the branch' name and location (local path or rsync URL).
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 name=$1
 location=$2
Index: cg-branch-ls
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-branch-ls  (mode:100755 
sha1:20b0a30ce30f73020f9b02a5d606577182444186)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-branch-ls  (mode:100755 
sha1:998505a87567a123e42fbd7dbc0233f524f6ed0c)
@@ -5,7 +5,16 @@
 #
 # Takes no parameters.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 mkdir -p .git/branches
 [ "$(find .git/branches -follow -type f)" ] \
Index: cg-cancel
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-cancel  (mode:100755 
sha1:0637536030d340f5e812868b40eb5d1b20612839)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-cancel  (mode:100755 
sha1:19eaae5e9ac6490a5ded2a6ec52f68652b294d81)
@@ -10,7 +10,16 @@
 #
 # Takes no arguments and the evil changes from the tree.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 # Undo seek?
 branch=
Index: cg-clone
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-clone  (mode:100755 
sha1:4ee0685c358e094c5350b3968d013105da6ddf7e)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-clone  (mode:100755 
sha1:eacefb54e1b1893db819b169e4d9d8f442e8fbcf)
@@ -8,7 +8,16 @@
 #
 # Takes an parameter specifying location of the source repository.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 location=$1
 [ "$location" ] || die "usage: cg-clone SOURCE_LOC"
Index: cg-commit
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-commit  (mode:100755 
sha1:053554d7a3e23ddcdab91a5e58e50286386092f2)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-commit  (mode:100755 
sha1:3e521cd21bf104c746ff8a3f3248c2f898d1ac1d)
@@ -10,7 +10,16 @@
 #
 # FIXME: Gets it wrong for filenames containing spaces.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 
 [ -s .git/blocked ] && die "committing blocked: $(cat .git/blocked)"
Index: cg-diff
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-diff  (mode:100755 
sha1:b0c3e7389c06718c789e40b9a4fdce0afcb17917)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-diff  (mode:100755 
sha1:37b48a84bb140be9e61838f293f510d4be65b3b3)
@@ -16,7 +16,16 @@
 #
 # Outputs a diff converting the first tree to the second one.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 
 id1=" "
@@ -72,7 +81,7 @@
 	# FIXME: Update ret based on what did we match. And take "$@"
 	# to account after all.
 	ret=
-	diff-cache -r -z $tree | xargs -0 cg-Xdiffdo "$tree" uncommitted "$filter"
+	diff-cache -r -z $tree | xargs -0 ${COGITO_LIB}cg-Xdiffdo "$tree" 
uncommitted "$filter"
 
 	if [ "$id1" != " " ]; then
 		rm $GIT_INDEX_FILE
@@ -89,6 +98,6 @@
 
 [ "$id1" = "$id2" ] && die "trying to diff $id1 against itself"
 
-diff-tree -r -z $id1 $id2 | xargs -0 cg-Xdiffdo $id1 $id2 "$filter"
+diff-tree -r -z $id1 $id2 | xargs -0 ${COGITO_LIB}cg-Xdiffdo $id1 $id2 
"$filter"
 
 [ "$filter" ] && rm $filter
Index: cg-export
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-export  (mode:100755 
sha1:d39eb8e723c8cb74c96b64d510f49d1bfcd7d5f8)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-export  (mode:100755 
sha1:94d419de48a12f1ea1059451ac4cd489f7008916)
@@ -6,7 +6,16 @@
 # Takes a target directory and optionally an id as a parameter,
 # defaulting to HEAD.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 destdir=$1
 id=$(tree-id $2)
Index: cg-help
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-help  (mode:100755 
sha1:36480174eba9cc54e9baba100cbd368fbced5c76)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-help  (mode:100755 
sha1:9d059861d899862f736f91c07459569b57df34de)
@@ -3,7 +3,16 @@
 # The help for the Cogito toolkit.
 # Copyright (c) Petr Baudis, 2005
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 cat <<__END__
 The Cogito version control system  $(cg-version)
Index: cg-init
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-init  (mode:100755 
sha1:d249140002888742c46ecba5925cae7c8025ea93)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-init  (mode:100755 
sha1:12d4716eb1b04f9d76a97e68ef6abd9f4ae62ef9)
@@ -6,7 +6,16 @@
 # Takes an optional parameter which will make it "clone" a specified
 # remote repository.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 uri=$1
 
Index: cg-log
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-log  (mode:100755 
sha1:15016b6df35021af01ef8a564c47dbe2e08a78a2)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-log  (mode:100755 
sha1:c7c4ecccb0844055c23a957a57385b787909883d)
@@ -18,7 +18,16 @@
 # Takes an id resolving to a commit to start from (HEAD by default),
 # or id1:id2 representing an (id1;id2] range of commits to show.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 if [ "$1" = "-c" ]; then
 	shift
Index: cg-ls
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-ls  (mode:100755 
sha1:5c9a90963252746e743b9295a47ffafc25ece848)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-ls  (mode:100755 
sha1:a09eaeb6df0b082a4accfed7aaeec4654621708b)
@@ -5,7 +5,16 @@
 #
 # Optionally takes commit or tree id as a parameter, defaulting to HEAD.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 id=$(tree-id $1) || exit 1
 
Index: cg-merge
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-merge  (mode:100755 
sha1:6f145b432be23419c82d5941e29b6bf082973f65)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-merge  (mode:100755 
sha1:49c2a76243dc8f917107be619d205fe518946da9)
@@ -13,7 +13,16 @@
 # Alternatively, it will just bring the HEAD forward, if your current
 # HEAD is also the merge base.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 head=$(commit-id)
 
@@ -84,7 +93,7 @@
 
 
 read-tree -m $(tree-id $base) $(tree-id $head) $(tree-id $branch) || die 
"read-tree failed"
-if ! merge-cache cg-Xmergefile -a || [ "$careful" ]; then
+if ! merge-cache ${COGITO_LIB}cg-Xmergefile -a || [ "$careful" ]; then
 	checkout-cache -f -a
 
 	# "Resolve" merges still in the cache (conflicts).
Index: cg-mkpatch
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-mkpatch  (mode:100755 
sha1:5ba423cbbb3e5f72cd7fb74f2873d49b60557f12)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-mkpatch  (mode:100755 
sha1:ae47a32b6ff819177301f339735366fdcf1fd207)
@@ -6,7 +6,16 @@
 # Takes commit ID, defaulting to HEAD, or id1:id2, forming a range
 # (id1;id2]. (Use "id1:" to take just everything from id1 to HEAD.)
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 
 showpatch () {
Index: cg-patch
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-patch  (mode:100755 
sha1:779c5985b78bc055d5296407d23cc00f628c9d23)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-patch  (mode:100755 
sha1:c2a57eadf8069c5cbec84979561bb2291f733f21)
@@ -8,7 +8,16 @@
 #
 # Takes the diff on stdin.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 gonefile=$(mktemp -t gitapply.XXXXXX)
 todo=$(mktemp -t gitapply.XXXXXX)
Index: cg-pull
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-pull  (mode:100755 
sha1:5cd67519fc5399886f22e8758d6d34e0e3014cbb)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-pull  (mode:100755 
sha1:e7a70ad7cb48ded1b28b9d2b137b4d50980bd0b7)
@@ -7,7 +7,16 @@
 #
 # Takes the branch' name.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 name=$1
 
Index: cg-rm
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-rm  (mode:100755 
sha1:1e0c64567767668454a0360785ac84883c7bbd58)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-rm  (mode:100755 
sha1:f2d2e0c042fdf9496d53e833a50d960331e145b4)
@@ -8,7 +8,16 @@
 # Optional "-n" parameter specifies that you don't want to remove directories
 # recursively.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 [ "$1" ] || die "usage: cg-rm [-n] FILE..."
 
Index: cg-seek
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-seek  (mode:100755 
sha1:29224219fc08893a41e75412dca2ac576f93c30e)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-seek  (mode:100755 
sha1:7537fcb6bfc00635cdd0d009a71e7786a7b367f7)
@@ -20,7 +20,16 @@
 #
 # Takes the target commit ID.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 dstcommit=$1
 
Index: cg-status
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-status  (mode:100755 
sha1:c9b69b9d54b6a6756f0ecad5324642eb66810b33)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-status  (mode:100755 
sha1:17bd538d9117b0b8bd7f7eaaaf1e2fd6552b9685)
@@ -5,7 +5,16 @@
 #
 # Takes no arguments.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 {
 	show-files -z -t --others --deleted --unmerged
Index: cg-tag
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-tag  (mode:100755 
sha1:a48da6d3e584d78aab30ffb0a5e93b29986eb5a1)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-tag  (mode:100755 
sha1:abc8dd69c1f9d0e023c2ed2d0b9982eb674f4f01)
@@ -8,7 +8,16 @@
 #
 # Takes the tag's name and optionally the associated ID.
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 name=$1
 id=$2
Index: cg-update
===================================================================
--- ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-update  (mode:100755 
sha1:956b69db12df0e41d0ff01ade090ef87f7c3fa22)
+++ bb131a04832677b22959ffe47f68900b94accc0c/cg-update  (mode:100755 
sha1:292faa316195fe254552367f849c60403d0770da)
@@ -6,7 +6,16 @@
 # Takes the branch' name; no parameter will cause it to update
 # against HEAD (only recovers lost files for now).
 
-. cg-Xlib
+if [ -z "$COGITO_LIB" ]; then
+  COGITO_LIB=$(dirname $(dirname $0))/lib/cogito
+  if [ -d $COGITO_LIB ]; then
+    COGITO_LIB=$COGITO_LIB/
+  else
+    COGITO_LIB=
+  fi
+fi
+
+. ${COGITO_LIB}cg-Xlib
 
 name=$1
 

^ permalink raw reply

* [PATCH] cogito recursive cg-add and cg-rm
From: Joshua T. Corbin @ 2005-04-26  4:27 UTC (permalink / raw)
  To: git

This patch adds recursive addition and removal to cg-add and cg-rm, recursion 
can be disabled with the -n switch.

Signed-off-by: Joshua T. Corbin <jcorbin@wunjo.org>

Index: cg-add
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/cg-add  (mode:100755 
sha1:8ba5351a4c7e28a577ea1aa4afa1078c54e9bccc)
+++ ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-add  (mode:100755 
sha1:1b7a821fd0b3f9702508503a082869ed4ec3ab52)
@@ -5,9 +5,31 @@
 #
 # Takes a list of file names at the command line, and schedules them
 # for addition to the GIT repository at the next commit.
+# Optional "-n" parameter specifies that you don't want to add directories
+# recursively.
 
 . cg-Xlib
 
-[ "$1" ] || die "usage: cg-add FILE..."
+[ "$1" ] || die "usage: cg-add [-n] FILE..."
 
-update-cache --add -- "$@"
+recur=1
+if [ "$1" = "-n" ]; then
+  shift
+  recur=
+fi
+
+if [ $recur ]; then
+  ADDFILE=$(mktemp -t gitadd.XXXXXX)
+  while [ "$1" ]; do
+    if [ -d "$1" ]; then
+      find $1 -type f -and -not -name '.*'
+    else
+      echo "$1"
+    fi
+    shift
+  done > $ADDFILE
+  update-cache --add -- $(cat $ADDFILE)
+  rm -f $RMFILE
+else
+  update-cache --add -- "$@"
+fi
Index: cg-help
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/cg-help  (mode:100755 
sha1:86f29161aadf15411244db9514a1fdfb03e664bd)
+++ ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-help  (mode:100755 
sha1:36480174eba9cc54e9baba100cbd368fbced5c76)
@@ -11,7 +11,7 @@
 Usage: cg-COMMAND [ARG]...
 
 Available commands:
- cg-add  FILE...
+ cg-add  [-n] FILE...
  cg-branch-add BNAME SOURCE_LOC
  cg-branch-ls
  cg-cancel
@@ -27,7 +27,7 @@
  cg-mkpatch [COMMIT_ID | COMMIT_ID:COMMIT_ID]
  cg-patch   < patch on stdin
  cg-pull  [BNAME]
- cg-rm  FILE...
+ cg-rm  [-n] FILE...
  cg-seek  [COMMIT_ID]
  cg-status
  cg-tag  TNAME [COMMIT_ID]
Index: cg-rm
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/cg-rm  (mode:100755 
sha1:029a03128eb7a8dd807335fea2ff52cb2bcda4fa)
+++ ddd5e0ab084034b713bb2f7d9de6f365d5a2e5bf/cg-rm  (mode:100755 
sha1:1e0c64567767668454a0360785ac84883c7bbd58)
@@ -5,10 +5,36 @@
 #
 # Takes a list of file names at the command line, and schedules them
 # for removal from the GIT repository at the next commit.
+# Optional "-n" parameter specifies that you don't want to remove directories
+# recursively.
 
 . cg-Xlib
 
-[ "$1" ] || die "usage: cg-rm FILE..."
+[ "$1" ] || die "usage: cg-rm [-n] FILE..."
 
-rm -f "$@"
-update-cache --remove -- "$@"
+recur=1
+if [ "$1" = "-n" ]; then
+  shift
+  recur=
+fi
+
+if [ $recur ]; then
+  RMFILE=$(mktemp -t gitrm.XXXXXX)
+  RMDIRS=
+  while [ "$1" ]; do
+    if [ -d "$1" ]; then
+      RMDIRS="$DIRS $1"
+      find $1 -type f -and -not -name '.*'
+    else
+      echo "$1"
+    fi
+    shift
+  done > $RMFILE
+  rm -f $(cat $RMFILE)
+  rmdir $(find $RMDIRS -depth -type d)
+  update-cache --remove -- $(cat $RMFILE)
+  rm -f $RMFILE
+else
+  rm -f "$@"
+  update-cache --remove -- "$@"
+fi

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Benjamin Herrenschmidt @ 2005-04-26  4:22 UTC (permalink / raw)
  To: pasky, git; +Cc: Linux Kernel list
In-Reply-To: <20050426032422.GQ13467@pasky.ji.cz>

On Tue, 2005-04-26 at 05:24 +0200, Petr Baudis wrote:
>   Hello,
> 
>   here goes Cogito-0.8, my SCMish layer over Linus Torvald's git tree
> history tracker. This package was formerly called git-pasky, however
> this release brings big changes. The usage is significantly different,
> as well as some basic concepts; the history changed again (hopefully the
> last time?) because of fixing dates of some old commits. The .git/
> directory layout changed too.
>
> .../...

Unless you already did this in the latest release, it would be nice to
have something like havign all the low level tools be by default in some
~/lib/git or whatever, and only the cg-* scripts in ~/bin on install,
unless maybe you pass some kind of I_AM_A_REAL_GIT=1 on the make
line ...

I don't really plan to use the low level tools, and I don't like the way
they clobber my bin namespace :)

Ben.



^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Andreas Gal @ 2005-04-26  4:22 UTC (permalink / raw)
  To: Chris Wedgwood; +Cc: Linus Torvalds, Matt Mackall, linux-kernel, git
In-Reply-To: <20050426040933.GA21178@taniwha.stupidest.org>


If adding a new arch touches 1000+ files, you're doing something 
_very_ wrong. Plus, how often did that happen in the past 10 years? 
30 times?? Probably less.

Andreas

On Mon, 25 Apr 2005, Chris Wedgwood wrote:

> On Mon, Apr 25, 2005 at 07:08:28PM -0700, Linus Torvalds wrote:
> 
> > If you're checking in a change to 1000+ files, you're doing
> > something wrong.
> 
> arch or subsystem merge?
> 
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Linus Torvalds @ 2005-04-26  4:22 UTC (permalink / raw)
  To: Chris Wedgwood; +Cc: Matt Mackall, linux-kernel, git
In-Reply-To: <20050426040933.GA21178@taniwha.stupidest.org>



On Mon, 25 Apr 2005, Chris Wedgwood wrote:
>
> On Mon, Apr 25, 2005 at 07:08:28PM -0700, Linus Torvalds wrote:
> 
> > If you're checking in a change to 1000+ files, you're doing
> > something wrong.
> 
> arch or subsystem merge?

No, if it's a merge, you just suck in all the already-compressed objects.  

You never compress anything new - you get the objects, you update your
tree index, and you're done. No overhead anywhere - a clean merge may
_look_ like it's changing thousands of files, but it didn't change a
single _object_ anywhere, it just re-arranged the objects and created a
new view of them.

Most merges are literally just a tree-level thing. Sometimes you have to 
do a content merge, but that tends to be a file or two.

			Linus

^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Linus Torvalds @ 2005-04-26  4:20 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel, git
In-Reply-To: <20050426040127.GK21897@waste.org>



On Mon, 25 Apr 2005, Matt Mackall wrote:
> 
> And the number of files checked in grows from ~1000 to ~6000. Note
> that git is growing from 4 to 19 seconds as well.

Heh,. I didn't much look at the git numbers, since I knew those were 
supposed to be linear in the size of the patch...

> I'm not versant enough with git enough to know how but I'll give it a
> shot. Do you have the patches in an mbox, perchance? This is Andrew's
> x/198 patch bomb?

Yes. I have my "tools" scripts for git in

	kernel.org:/pub/linux/kernel/people/torvalds/git-tools.git

and I sent out the script I used to test the 2.6.12-rc2 + patches stuff in 
the previous email, so you would just have to edit my mbox-applicator 
tools to work with hg and get comparable numbers.

> It might be simpler for me to just apply everything
> in -mm to git and hg and compare times.

That should work.

> > You're doing something wrong with git here. Why would you need to update 
> > your cache?
> 
> Quite possibly. Without it, I was getting a dump of a bunch of SHAs.
> I'm pretty git-ignorant, I've been focusing on something else for the
> past couple weeks.

Getting a bunch of SHA's means that the file contents match, but that your 
index file wasn't up-to-date, so git had to actually uncompress the object 
backing store and _compare_ the file contents to notice.

And I suspect that you may have done _all_ your numbers without ever
having initialized the git index, in which case git will really suck raw
eggs, because git will basically always re-read every file (it will never
realize that they are up-to-date already).

Basically, the theory of git operation is that the index file should
_always_ be up-to-date.  Normally you don't have to do anything about it,
since the git helper tools will always just keep it that way, but if you
didn't, then..

		Linus

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Mike Taht @ 2005-04-26  4:12 UTC (permalink / raw)
  To: pasky, git; +Cc: linux-kernel
In-Reply-To: <20050426032422.GQ13467@pasky.ji.cz>


>   Yes, this is a huge change. No, I don't expect any further changes of
> similar scale. I think the new interface is significantly simpler _and_
> cleaner than the old one.

Heh. Another huge change would be moving the top level directories 
around a bit.


bindings  COPYING  git.spec  Makefile  programs  README.reference  tests
contrib   doc      include   po        README    src  VERSION

Leaving fixing the makefiles aside as an exercise for the interested 
reader... that's:

#!/bin/sh

# completely rearrange the file structure of cogito/git
# just to make pasky and other scm users insane once again
# FIXME - fix the makefiles, git.spec

CFILES=`ls *.c`
DFILES=`ls ppc/* mozilla-sha1/*`
HFILES=`ls *.h`
SRCDIR=src # or libgit?
INCDIR=include/git-guts # or keep in SRCDIR or include/git or whatever
COGDIR=programs/cogito # or just cogito. is git-web likely to be inc?

mkdir -p $SRCDIR $INCDIR $COGDIR \
bindings/perl bindings/python bindings/ruby po tests doc # just ideas,
# no files (yet)

mv $CFILES ppc mozilla-sha1 $SRCDIR
mv $HFILES $INCDIR
COGFILES=`file * | grep "script text executable" | cut -f1 -d:`
mv $COGFILES $COGDIR

cg-rm $CFILES $HFILES $COGFILES
for i in $CFILES $DFILES
do
         cg-add $SRCDIR/$i
done
for i in $HFILES
do
         cg-add $INCDIR/$i
done

cg-commit




-- 

Mike Taht


   "A straw vote only shows which way the hot air blows.
	-- O'Henry"

^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Chris Wedgwood @ 2005-04-26  4:09 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Matt Mackall, linux-kernel, git
In-Reply-To: <Pine.LNX.4.58.0504251859550.18901@ppc970.osdl.org>

On Mon, Apr 25, 2005 at 07:08:28PM -0700, Linus Torvalds wrote:

> If you're checking in a change to 1000+ files, you're doing
> something wrong.

arch or subsystem merge?


^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Matt Mackall @ 2005-04-26  4:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, git
In-Reply-To: <Pine.LNX.4.58.0504251859550.18901@ppc970.osdl.org>

On Mon, Apr 25, 2005 at 07:08:28PM -0700, Linus Torvalds wrote:
> 
> 
> On Mon, 25 Apr 2005, Matt Mackall wrote:
> >
> > Here are the results of checking in the first 12 releases of Linux 2.6
> > into empty repositories for Mercurial v0.3 (hg) and git-pasky-0.7.
> > This is on my 512M Pentium M laptop. Times are in seconds.
> > 
> >                  user         system       real        du -sh
> > ver    files   hg    git    hg    git    hg    git    hg   git
> > 
> > 2.6.0  15007 19.949 35.526 3.171 2.264 25.138 87.994 145M   89M
> > 2.6.1    998  5.906  4.018 0.573 0.464 10.267  5.937 146M   99M
> > 2.6.2   2370  9.696 13.051 0.752 0.652 12.970 15.167 150M  117M
> > 2.6.3   1906 10.528 11.509 0.816 0.639 18.406 14.318 152M  135M
> > 2.6.4   3185 11.140  7.380 0.997 0.731 15.265 12.412 156M  158M
> > 2.6.5   2261 10.961  6.939 0.843 0.640 20.564  8.522 158M  177M
> > 2.6.6   2642 11.803 10.043 0.870 0.678 22.360 11.515 162M  197M
> > 2.6.7   3772 18.411 15.243 1.189 0.915 32.397 21.498 165M  227M
> > 2.6.8   4604 20.922 16.054 1.406 1.041 39.622 25.056 172M  262M
> > 2.6.9   4712 19.306 12.145 1.421 1.102 35.663 24.958 179M  297M
> > 2.6.10  5384 23.022 18.154 1.393 1.182 40.947 32.085 186M  338M
> > 2.6.11  5662 27.211 19.138 1.791 1.253 42.605 31.902 193M  379M
> 
> That time in checking things in is worrisome.
> 
> "git" is basically linear in the size of the patch, which is what I want,
> since most patches I work with are a couple of files at most. The patches
> you are checking in are huge - I never actually work with a change that is
> as big as a whole release. I work with changes that are five files or
> something.

Git (and hg) commit time should be basically linear in the number of
files touched, not the size of the patch.

> "hg" seems to basically slow down the more patches you have applied. It's 
> hard to tell from the limited test set, but look at "user" time. It seems 
> to increase from 6 seconds to 27 seconds.

And the number of files checked in grows from ~1000 to ~6000. Note
that git is growing from 4 to 19 seconds as well. Interestingly:

19.138/4.018 = 4.76 (git time ratio)
27.211/5.906 = 4.61 (hg time ratio)

So the scaling here is pretty similar.

> To make an interesting benchmark, try applying the first 200 patches in 
> the current git kernel archive. Can you do them three per second? THAT is 
> the thing you should optimize for, not checking in huge changes.

I'm not versant enough with git enough to know how but I'll give it a
shot. Do you have the patches in an mbox, perchance? This is Andrew's
x/198 patch bomb? It might be simpler for me to just apply everything
in -mm to git and hg and compare times. Modulo python startup time, it
should be pretty similar.

Oh, and can you send me the script you used for your test with git?

> If you're checking in a change to 1000+ files, you're doing something
> wrong.

That's primarily to demonstrate the scalability and show the
divergence in repository sizes.

However, it will not be uncommon for developers to pull/merge changes that
large and the numbers here will be about the same for hg.

> > Full-tree working dir diff (2.6.0 base with 2.6.1 in working dir):
> > hg:  real 4.920s  user 4.629s  sys 0.260s
> > git: real 3.531s  user 1.869s  sys 0.862s
> > (this needed an update-cache --refresh on top of git commit, which
> > took another: real 2m52.764s  user 2.833s  sys 1.008s)
> 
> You're doing something wrong with git here. Why would you need to update 
> your cache?

Quite possibly. Without it, I was getting a dump of a bunch of SHAs.
I'm pretty git-ignorant, I've been focusing on something else for the
past couple weeks.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Linus Torvalds @ 2005-04-26  4:00 UTC (permalink / raw)
  To: Mike Taht; +Cc: Matt Mackall, linux-kernel, git
In-Reply-To: <Pine.LNX.4.58.0504251938210.18901@ppc970.osdl.org>



On Mon, 25 Apr 2005, Linus Torvalds wrote:
> 
> The easiest test-case is Andrew's 198-patch patch-bomb on linux-kernel a 
> few weeks ago: they all apply cleanly to 2.6.12-rc2 (in order), and you 
> can use my "dotest" script to automate the test..

Oh, well. That was so trivial that I just did it:

With Z_BEST_COMPRESSION:

	torvalds@ppc970:~/git-speed-1> ./script 
	Removing old tree
	Creating new tree
	Initializing db
	defaulting to local storage area
	Doing sync
	Initial add
	
	real    0m37.526s
	user    0m33.317s
	sys     0m3.816s
	Initial commit
	Committing initial tree 0bba044c4ce775e45a88a51686b5d9f90697ea9d
	
	real    0m0.329s
	user    0m0.152s
	sys     0m0.176s
	Patchbomb
	
	real    0m50.408s
	user    0m18.933s
	sys     0m25.432s

With Z_DEFAULT_COMPRESSION:

	torvalds@ppc970:~/git-speed-1> ./script 
	Removing old tree
	Creating new tree
	Initializing db
	defaulting to local storage area
	Doing sync
	Initial add
	
	real    0m19.755s
	user    0m15.719s
	sys     0m3.756s
	Initial commit
	Committing initial tree 0bba044c4ce775e45a88a51686b5d9f90697ea9d
	
	real    0m0.337s
	user    0m0.139s
	sys     0m0.197s
	Patchbomb
	
	real    0m50.465s
	user    0m18.304s
	sys     0m25.567s

ie the "initial add" is almost twice as fast (because it spends most of
the time compressing _all_ the files), but the difference in applying 198
patches is not noticeable at all (because the costs are all elsewhere).

That's 198 patches in less than a minute even with the highest
compression. That rocks.

And don't try to make me explain why the patchbomb has any IO time at all,
it should all have fit in the cache, but I think the writeback logic
kicked in. Anyway, I tried it several times, and the real-time ends up 
fluctuating between 50-56 seconds, but the user/sys times are very stable, 
and end up being pretty much the same regardless of compression level.

Here's the script, in case anybody cares:

	#!/bin/sh
	echo Removing old tree
	rm -rf linux-2.6.12-rc2
	echo Creating new tree
	zcat < ~/v2.6/linux-2.6.12-rc2.tar.gz | tar xvf - > log
	echo Initializing db
	( cd linux-2.6.12-rc2 ; init-db )
	echo Doing sync
	sync
	echo Initial add
	time sh -c 'cd linux-2.6.12-rc2 && cat ../l | xargs update-cache --add --' >> log
	echo Initial commit
	time sh -c 'cd linux-2.6.12-rc2 && echo Initial commit | commit-tree 
	$(write-tree) > .git/HEAD' >> log
	echo Patchbomb
	time sh -c 'cd linux-2.6.12-rc2 ; dotest ~/andrews-first-patchbomb' >> log

and since the timing results were pretty much what I expected, I don't 
think this changes _my_ opinion on anything. Yes, you can speed up commits 
with Z_DEFAULT_COMPRESSION, but it's _not_ that big of a deal for my kind 
of model where you commit often, and commits are small.

It all boils down to:
 - huge commits are slowed down by compression overhead
 - I don't think huge commits really matter

I mean, if it took 2 _hours_ to do the initial commit, I'd think it 
matters. But when we're talking about less than a minute to create the 
initial commit of a whole kernel archive, does it really make any 
difference?

After all, it's something you do _once_, and never again (unless you
script it to do performance testing ;)

Anyway guys, feel free to test this on other machines. I bet there are
lots of subtle performance differences between different filesystems and
CPU architectures.. But the only hard numbers I have show that -9 isn't 
that expensive.

			Linus

^ permalink raw reply

* Re: [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Petr Baudis @ 2005-04-26  3:29 UTC (permalink / raw)
  To: git; +Cc: linux-kernel
In-Reply-To: <20050426032422.GQ13467@pasky.ji.cz>

Dear diary, on Tue, Apr 26, 2005 at 05:24:22AM CEST, I got a letter
where Petr Baudis <pasky@ucw.cz> told me that...
>   here goes Cogito-0.8, my SCMish layer over Linus Torvald's git tree
> history tracker. This package was formerly called git-pasky, however
> this release brings big changes. The usage is significantly different,
> as well as some basic concepts; the history changed again (hopefully the
> last time?) because of fixing dates of some old commits. The .git/
> directory layout changed too.

I forgot to mention that you should really only upgrade if you feel
brave and are willing to do some testing; it is likely there are some
new bugs introduced by the renaming, some leftovers of the original
git-pasky stuff in some not-so-frequently called scripts, etc. I will
see how many bug reports will we get and how fast will the bugcount
drop; if things won't stabilize very quickly, I might release
git-pasky-0.7.1 with few obvious bugfixes.

(And don't write announcements at 4am.)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

^ permalink raw reply

* [ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)
From: Petr Baudis @ 2005-04-26  3:24 UTC (permalink / raw)
  To: git; +Cc: linux-kernel

  Hello,

  here goes Cogito-0.8, my SCMish layer over Linus Torvald's git tree
history tracker. This package was formerly called git-pasky, however
this release brings big changes. The usage is significantly different,
as well as some basic concepts; the history changed again (hopefully the
last time?) because of fixing dates of some old commits. The .git/
directory layout changed too.

  Upgrading through pull is possible, but rather difficult and requires
some intimacy with both git, git-pasky and Cogito. So probably the best
way to go is to just get cogito-0.8 tarball at

	http://www.kernel.org/pub/software/scm/cogito/

or

	ftp://ftp.kernel.org/pub/software/scm/cogito/

build and install it, and do

	cg-clone rsync://rsync.kernel.org/pub/scm/cogito/cogito.git



  Yes, this is a huge change. No, I don't expect any further changes of
similar scale. I think the new interface is significantly simpler _and_
cleaner than the old one.

  First for the concept changes. There is no concept of tracking
anymore; you just do either cg-pull to just fetch the changes, or
cg-update to fetch them as well as merge them to your working tree.
Even more significant change is that Cogito does not directly support
local branches anymore - git fork is gone, you just go to new directory
and do

	cg-init ~/path/to/your/original/repository

(or cg-clone, which will try to create a new subdirectory for itself).
This now acts as a separate repository, except that it is hardlinked
with the original one; therefore you get no additional disk usage.  To
get new changes to it from the original repository, you have to
cg-update origin. If you decide you want to merge back, go to the
original repository, add your new one as a branch and pull/update from
it.

  As for the interface changes, you will probably find out on your own;
cg-help should be of some help. All the scripts now start with 'cg-',
and you should ignore the 'cg-X*' ones. The non-trivial mapping is:

	git addremote -> cg-branch-add
	git lsremote -> cg-branch-ls
	git patch -> cg-mkpatch
	git apply -> cg-patch
	git lsobj -> cg-admin-lsobj

  Commands that are gone:

	git fork
	git track

  New commands:

	cg-clone
	cg-update



  Of course other changes include various bugfixes, and latest Linus'
stuff (although we do not make use of Linus' tags yet).

  Note that I don't know how many time will I have for hacking Cogito
until the next Sunday/Monday. I hope I will get some time to at least
apply bugfixes etc, but I don't know how much more will I be able to do.
You would make me a happy man if you could please port your pending
patches from git-pasky to Cogito; I promise to apply them and I hope
there isn't going to be another so big change in the foreseeable future,
which would cause major conflicts for your patches etc.


  Note that I cc'd LKML since it is going to break stuff for anyone
using git-pasky now (apologies for that; it won't happen another time).
Please try not to keep it in the cc' list unless it is really relevant.

  Have fun,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

^ permalink raw reply

* Re: Mercurial 0.3 vs git benchmarks
From: Linus Torvalds @ 2005-04-26  3:04 UTC (permalink / raw)
  To: Mike Taht; +Cc: Matt Mackall, linux-kernel, git
In-Reply-To: <426DA7B5.2080204@timesys.com>



On Mon, 25 Apr 2005, Mike Taht wrote:
> 
> One difference is probably - mercurial appears to be using zlib's 
> *default* compression of 6....
> 
> using zlib compression of 9 really impacts git...

I agree that it will hurt for big changes, but since I really do believe 
that most changes are just a couple of files, I don't believe it matters 
for those. 

I forget what the exact numbers were, but I did some timings on plain
"gzip", and it basically said that doing gzip on a medium-sized file was
not that different for -6 and -9. Why? Because most of the overhead was
elsewhere ;)

Oh, well, I just re-created some numbers. This wasn't exactly what I did 
last time I tested it, but it's conceptually the same thing:

	torvalds@ppc970:~> time gzip -9 < v2.6/linux/kernel/sched.c > /dev/null 
	real    0m0.018s
	user    0m0.018s
	sys     0m0.000s

	torvalds@ppc970:~> time gzip -6 < v2.6/linux/kernel/sched.c > /dev/null 
	real    0m0.015s
	user    0m0.013s
	sys     0m0.001s

ie there's a 0.003 second difference, which is certainly noticeable, and
would be hugely noticeable if you did a lot of these. But in my world-view
(which is what git is optimized for), the common case is that you usually
end up compressing maybe five-ten files, so the _compression_ overhead is
not that huge compared to all the other stuff.

But yes, testing git on big changes will test exactly the things that git
isn't optimized for. I think git will normally hold up pretty well (ie it
will still beat anything that isn't designed for speed, and will be
comparable to things that _are_), but it's not what I'm interested in
optimizing for.

That said - these days we can trivially change over to a "zlib -6" 
compression, and nothing should ever notice. So if somebody wants to 
test it, it should be fairly easy to just compare side-by-side: the 
results should be identical.

The easiest test-case is Andrew's 198-patch patch-bomb on linux-kernel a 
few weeks ago: they all apply cleanly to 2.6.12-rc2 (in order), and you 
can use my "dotest" script to automate the test..

			Linus

^ permalink raw reply

* Re: git "tag" objects implemented - and a re-done commit
From: Sean @ 2005-04-26  2:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andreas Gal, Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0504251530480.18901@ppc970.osdl.org>

On Mon, April 25, 2005 6:39 pm, Linus Torvalds said:
>
> Ok, for the intrepid users, you can now test to see if you can pick them
out. fsck should make them totally obvious, and here's my public key in
case you also want to verify the things.
>
> Of course, since I normally don't use pgp signing etc, it's entirely
possible that I've done something stupid, and I'm now sending you my
secret key and my full porn-collection.
>


Linus,

Looks good:

$ gpg --import torvalds.pgp
$ gpg --edit-key Linus trust
gpg --edit-key Linus trust
 1 = Don't know
 2 = I do NOT trust
 3 = I trust marginally
 4 = I trust fully
 5 = I trust ultimately
 m = back to the main menu

Your decision? 5
Do you really want to set this key to ultimate trust? y



$ fsck-cache  --tags
tagged commit a2755a80f40e5794ddc20e00f781af9d6320fafb (v2.6.12-rc3) in
0397236d43e48e821cce5bbe6a80a1a56bb7cc3a
tagged commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (v2.6.12-rc2) in
9e734775f7c22d2f89943ad6c745571f1930105f
expect dangling commits - potential heads - due to lack of head
information
dangling commit b453257f057b834fdf9f4a6ad6133598b79bd982



$ chksig.sh 0397236d43e48e821cce5bbe6a80a1a56bb7cc3a
gpg: Signature made Mon Apr 25 18:27:55 2005 EDT using DSA key ID 76E21CBB
gpg: Good signature from "Linus Torvalds (tag signing key)
<torvalds@osdl.org>"



chksig.sh:

#!/bin/sh
TAG=$1
cat-file tag $TAG | sed -ne '/BEGIN PGP/,/END PGP/p' > .tmp.sig
cat-file tag $TAG | sed -e '/BEGIN PGP/,/END PGP/d' | \
        gpg --verify .tmp.sig -
rm -f .tmp.sig



Sean





^ permalink raw reply

* Re: Revised PPC assembly implementation
From: linux @ 2005-04-26  2:35 UTC (permalink / raw)
  To: davem, paulus; +Cc: git, linux
In-Reply-To: <20050425161746.7d943e62.davem@davemloft.net>

(Sorry about that last e-mail.  gnome-terminal crashed and sent the file
before I edited it.  Here's what I meant to send.)

> Do a block with the integer ALUs in parallel with a block done using
> Altivec :-)  There should be enough spare insn slots so that the loads
> are absorbed properly.

Unfortunately, the blocks are connected by a data dependency.
It's basically a large-key block cipher, chained by:

iv[] = fixed_initial_value.
iv[] += encrypt(iv, text[0..63])
iv[] += encrypt(iv, text[64..127])
iv[] += encrypt(iv, text[128..191])
iv[] += encrypt(iv, text[192..255])
etc.

There is no coarse-grain parallelism to exploit, unless you want
to be hashing two separate files at once.  Which would do too much
damage to the structure of the source to be worth considering.

> Unlike UltraSPARC's VIS, with altivec you can reasonably do shifts and
> rotates, which is the only reason I'm suggesting this.

I don't quite think it's worth it, though.  It's not data-parallel
enough.

We could theoretically use it to form the w[] vector, but that's only
4 instructions in registers which are very flexibly schedulable and
nicely fill in the cracks between other instructions.

Oh, here's STEPD1+UPDATEW scheduled optimally for the G4.  %r5 holds the
constant K.  Note that t < s <= t+16.  W(s) and W((s)-16) are actually
the same register.

add   RE(t),RE(t),W(t);	xor    %r0,RD(t),RB(t);	xor    W(s),W((s)-16),W((s)-3);
add   RE(t),RE(t),%r5;	xor    %r0,%r0,RC(t);	xor    W(s),W(s),W((s)-8);
add   RE(t),RE(t),%r0;	rotlwi %r0,RA(t),5;	xor    W(s),W(s),W((s)-14);
add   RE(t),RE(t),%r0;	rotlwi RB(t),RB(t),30;	rotlwi W(s),W(s),1;

However, whether that can be done in 6 cycles on a G5 is a bit unclear.
It can't be 6 consecutive cycles, but with some motion of code
across the edges, perhaps...

0: add   RE(t),RE(t),W(t);		xor    %r0,RD(t),RB(t);
1: xor    W(s),W((s)-16),W((s)-3);	(add)
2: add   RE(t),RE(t),%r5;		xor    %r0,%r0,RC(t);
3: xor    W(s),W(s),W((s)-8);		(rotlwi)
4: add   RE(t),RE(t),%r0;		rotlwi %r0,RA(t),5;
5: xor    W(s),W(s),W((s)-14);		rotlwi RB(t),RB(t),30;
6:
7: add   RE(t),RE(t),%r0;
8:
9: rotlwi W(s),W(s),1;

The problem there is forcing that ordering, rather than issuing the final
add in cycle 6 and pushing everything else ahead of it.


STEPD0+UPDATEW and STEPD1+UPDATEW are 13 and 14 instructions,
respectively, and don't fit into a 3-issue machine as neatly.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox