Git development
 help / color / mirror / Atom feed
* [PATCH] Define a shell function to check tree cleanness.
From: Junio C Hamano @ 2005-08-26  8:03 UTC (permalink / raw)
  To: git

This would be used in places where we require a clean tree, such
as reverting and rebasing.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 git-sh-setup-script |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

1de6046ded332e2278320be314f7a5e31a431e14
diff --git a/git-sh-setup-script b/git-sh-setup-script
--- a/git-sh-setup-script
+++ b/git-sh-setup-script
@@ -11,6 +11,17 @@ die() {
 	exit 1
 }
 
+check_clean_tree() {
+    dirty1_=`git-update-cache -q --refresh` && {
+    dirty2_=`git-diff-cache --name-only --cached HEAD`
+    case "$dirty2_" in '') : ;; *) (exit 1) ;; esac
+    } || {
+	echo >&2 "$dirty1_"
+	echo "$dirty2_" | sed >&2 -e 's/^/modified: /'
+	(exit 1)
+    }
+}
+
 [ -d "$GIT_DIR" ] &&
 [ -d "$GIT_DIR/refs" ] &&
 [ -d "$GIT_OBJECT_DIRECTORY" ] &&

^ permalink raw reply

* [PATCH] Fix the status output when there is nothing to commit.
From: Junio C Hamano @ 2005-08-26  8:04 UTC (permalink / raw)
  To: git

It had an extra empty '#' line.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 git-commit-script |    4 ++--
 git-status-script |    3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

22758793f9cde4379bacb067e2a4551373eaf073
diff --git a/git-commit-script b/git-commit-script
--- a/git-commit-script
+++ b/git-commit-script
@@ -195,8 +195,8 @@ else
 fi
 if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
 then
-	sed -ne '/^#/p' .editmsg
-	rm .editmsg
+	rm -f .editmsg
+	git-status-script
 	exit 1
 fi
 case "$no_edit" in
diff --git a/git-status-script b/git-status-script
--- a/git-status-script
+++ b/git-status-script
@@ -31,8 +31,7 @@ report () {
 branch=`readlink "$GIT_DIR/HEAD"`
 case "$branch" in
 refs/heads/master) ;;
-*)	echo "#
-# On branch $branch" ;;
+*)	echo "# On branch $branch" ;;
 esac
 git-update-cache --refresh >/dev/null 2>&1
 git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"

^ permalink raw reply

* [PATCH] Redo "revert" using three-way merge machinery.
From: Junio C Hamano @ 2005-08-26  8:04 UTC (permalink / raw)
  To: git

The reverse patch application using "git apply" sometimes is too
rigid.  Since the user would get used to resolving conflicting merges
by hand during the normal merge experience, using the same machinery
would be more helpful rather than just giving up.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 git-revert-script |   75 ++++++++++++++++++++++++++++++-----------------------
 1 files changed, 42 insertions(+), 33 deletions(-)

186bb385d806bf08b5a81888230ad7a96aec50c7
diff --git a/git-revert-script b/git-revert-script
--- a/git-revert-script
+++ b/git-revert-script
@@ -2,38 +2,47 @@
 . git-sh-setup-script || die "Not a git archive"
 
 # We want a clean tree and clean index to be able to revert.
-dirty=`git-diff-cache --name-only --cached HEAD`
-case "$dirty" in '') dirty=`git-diff-cache --name-only HEAD` ;; esac
-case "$dirty" in
-'') ;;
-*)
-	echo >&2 "Modified:"
-	echo "$dirty" | sed >&2 -e 's/^/	/'
-	die "Your working tree is dirty; cannot revert a previous patch." ;;
-esac
+check_clean_tree || die "Cannot run revert from a dirty tree."
 
 rev=$(git-rev-parse --verify "$@") &&
-commit=$(git-rev-parse --verify "$rev^0") || exit
-if git-diff-tree -R -M -p $commit | git-apply --index &&
-   msg=$(git-rev-list --pretty=oneline --max-count=1 $commit)
-then
-        {
-                echo "$msg" | sed -e '
-			s/^[^ ]* /Revert "/
-			s/$/"/'
-                echo
-                echo "This reverts $commit commit."
-                test "$rev" = "$commit" ||
-                echo "(original 'git revert' arguments: $@)"
-        } | git commit -F -
-else
-        # Now why did it fail?
-        parents=`git-cat-file commit "$commit" 2>/dev/null |
-                sed -ne '/^$/q;/^parent /p' |
-                wc -l`
-        case $parents in
-        0) die "Cannot revert the root commit nor non commit-ish." ;;
-        1) die "The patch does not apply." ;;
-        *) die "Cannot revert a merge commit." ;;
-        esac
-fi
+commit=$(git-rev-parse --verify "$rev^0") ||
+	die "Not a single commit $@"
+head=$(git-rev-parse --verify HEAD) ||
+	die "You do not have a valid HEAD"
+prev=$(git-rev-parse --verify "$commit^1" 2>/dev/null) ||
+	die "Cannot revert a root commit"
+git-rev-parse --verify "$commit^2" >/dev/null 2>&1 &&
+	die "Cannot revert a multi-parent commit."
+
+# "commit" is an existing commit.  We would want to apply
+# the difference it introduces since its first parent "prev"
+# on top of the current HEAD.
+
+{
+	git-rev-list --pretty=oneline --max-count=1 $commit |
+	sed -e '
+		s/^[^ ]* /Revert "/
+		s/$/"/'
+	echo
+	echo "This reverts $commit commit."
+	test "$rev" = "$commit" ||
+	echo "(original 'git revert' arguments: $@)"
+} >.revertmsg
+
+# This three way merge is an interesting one.  We have come from
+# $commit to $head, and would want to apply the change between $commit
+# and $prev to us.
+git-read-tree -m -u $commit $head $prev &&
+result=$(git-write-tree 2>/dev/null) || {
+    echo >&2 "Simple revert fails; trying automated revert."
+    git-merge-cache -o git-merge-one-file-script -a || {
+	    echo >&2 "Automated revert failed.  After fixing it up,"
+	    echo >&2 "you can use \"git commit -F .revertmsg\""
+	    exit 1
+    }
+    result=$(git-write-tree) || exit
+}
+
+git commit -F .revertmsg
+rm -f .revertmsg
+

^ permalink raw reply

* Re: Merges without bases
From: Martin Langhoff @ 2005-08-26  9:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Darrin Thompson, git
In-Reply-To: <7vvf1tps9v.fsf@assigned-by-dhcp.cox.net>

On 8/26/05, Junio C Hamano <junkio@cox.net> wrote:
> their core GIT tools come from.  But how would _I_ pull from
> that "My Project", if I did not want to pull unrelated stuff in?

and then... 

> What I think _might_ deserve a bit more support would be a merge
> of a foreign project as a subdirectory of a project.  Linus

tla has an interesting implementation (and horrible name) for
something like this. In Arch-speak, they are called 'configurations',
a versioned control file that describes that in subdirectory foo we
import from this other repo#branch.

In cvs, you just do nested checkouts, and trust a `cvs update` done at
the top will do the right thing;  and in fact recent cvs versions do.

After using cvs and arch for a while, my opinion is that all this
stuff is _bad_, and you want a makefile that pulls the projects
together when you build them. Different projects are going to use
different SCMs anyway, and you'll have to live with how to tag a
release across repositories/scms, and I haven't seen any answer I
like.

cheers,


martin

^ permalink raw reply

* Multiple pack files in .git/objects/pack
From: Martin Langhoff @ 2005-08-26  9:25 UTC (permalink / raw)
  To: GIT

I suspect I may have cancelled a git-repack-script execution, and now
a repo has a redundant pack eating 70MB. I can tell the right one by
running git-repack-script again, and nuking the "older" one, but is
there a reliable way to determine which pack is the correct one?

>From the behaviour of the http transfers, there is a pointer to it somewhere. 

cheers,


martin

^ permalink raw reply

* Re: [RFC] Looking at multiple ancestors in merge
From: Junio C Hamano @ 2005-08-26  9:29 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0508260108290.23242@iabervon.org>

Daniel Barkalow <barkalow@iabervon.org> writes:

> I've started this, and have gotten as far as having read-tree accept > 3
> trees and ignore everything but the last 3. Am I correct in assuming that
> if I break read-tree in any way, some test will fail?

If some test fails you would know you broke it, but the inverse
is probably not always true.

I think the current read-tree test suite has reasonably wide
coverage of all the interesting cases.  But the definition of
"interesting" was derived from the current world order (IOW, the
test suite was designed around the way we do things right now as
a whitebox test, not a blackbox test).  I would not be surprised
if some of them did not catch breakage you may introduce during
the development.

I wonder however if extending the current way of doing things in
the cache is the right thing.  Right now we use two bits out of
the top four bits for recording stage, one bit for the update
bit, so you have only one extra bit to extend the number of
stages, which means you could hold at most 7 trees at once.

You "ignore things but the last 3", so this may not be too much
of a problem, but I am a bit puzzled what you meant by it
though.  Are you talking about reading more than 3 trees and
keeping only the 3 to be merged, discarding the rest, doing the
selection per path?

^ permalink raw reply

* SVN import issue
From: Matthias Urlichs @ 2005-08-26 10:40 UTC (permalink / raw)
  To: git

Hi,

I'm off to the beach for the next two weeks, so if somebody wants to
munge cvs2git into svn2git, here's the basics on how to pull from a
remote SVN repo:


#!/usr/bin/perl

use strict;
use warnings;
use SVN::Core;
use SVN::Ra;

my(@new,@del,@mod);
sub show_log {
	my ($changed_paths, $revision, $author, $date, $message, $pool) = @_;
	$author = '<unknown>' unless defined $author;
	@new = (); @del = (); @mod = ();

	(my $pmessage = $message) =~ s/\n/\n    /g;
	print "*** $revision: $author \@ $date:\n<<< $pmessage>>>\n";
	print "Files:\n";
	while(my($path,$action) = each %$changed_paths) {
		my $act = $action->action;
		my $oldpath = $action->copyfrom_path;
		my $oldrev = $action->copyfrom_rev;
		$oldrev = undef if defined $oldrev and $oldrev <= 0;
		$oldpath = undef if defined $oldpath and ($oldpath eq "" or $oldpath eq $path);
		print "$act $path";
		print " <-" if $oldpath or $oldrev;
		print " $oldpath" if defined $oldpath;
		print " $oldrev" if defined $oldrev;
		print "\n";
		if($act eq "A") {
			push(@new,$path);
		} elsif($act eq "D") {
			push(@del,$path);
		} else {
			push(@mod,$path);
		}
	}
}


my $ra = SVN::Ra->new("svn://cvs.gnupg.org/gnupg");

my $latest = $ra->get_latest_revnum();
my $n = 1;
while($n <= $latest) {
	$ra->get_log("/",$n,$n,$n,1,1,\&show_log,"");

	foreach my $path(@new,@mod) {
		print "Reading $path, $n...\n";
		open(F,">/tmp/foo"); # ( OK, so use tempfile() here ;-)
		eval {
			$ra->get_file($path,$n,\*F);
		};
		close(F);
		if ($@) {
			print "... not a file\n";
			next;
		}
		my $sz = (stat("/tmp/foo"))[7];
		print "... done, $sz bytes\n.";
	}
} continue {
	$n++;
}

Paths in SVN are usually prefixed "/trunk/" (main branch) or
"/branches/foo/" (branch foo); tagging is done by creating "/tags/bar",
with the trunk (or branch) revision it is pointing to as its parent. 

So a branch point looks like this:

*** 350: <unknown> @ 1999-09-18T11:04:00.000000Z:
<<< This commit was manufactured by cvs2svn to create branch
    'STABLE-BRANCH-1-0'.>>>
Files:
A /branches/STABLE-BRANCH-1-0/cipher/rndw32.c <- /trunk/cipher/rndw32.c 349
A /branches/STABLE-BRANCH-1-0 <- /trunk 348

(and of *course* it may have changes from other revisions in it,
anything else would simply be too easy I guess...). Tags look like they
do, see tag 1-0-0 in the above repo; that seems to happen because their
CVS importer couldn't find a sane branchpoint. cvsps reports the same thing.

I haven't yet examined what a SVN merge looks like.

Nothing stops a SVN check-in from touching multiple branches at the same
time, though in practice that doesn't happen.

The mapping of SVN revision numbers to git SHA1s could get a bit
annoying because incremental imports need to work. Personally I'd use a
.svnmap file which has "svnid sha1" lines inside. The last line
obviously would not have a sha1 because we can't know that before
checking in the file...


So, if I find a working SVN importer when I come back I'll be happy  ;-)
(munging cvs2git shouldn't be particularly difficult), otherwise I'll do
it myself, in a month or so.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I had been driving my car for 40 years when I fell asleep at the wheel and
had an accident.

^ permalink raw reply

* [PATCH] git bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:00 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540043384-git-send-email-tv@debian.org>

Generate docs for gitk. Install them in the right deb package.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 56bb91cb027a0e0dc8d896d26906597088ee6372
tree 6be1279d6a87b42e9b726ee7883ebe4e81d1fd01
parent f4d2a91b2946330c4bf240cf73e64684cba43ddf
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:29 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:29 +0300

 Documentation/Makefile |    2 +-
 debian/git-tk.files    |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,4 +1,4 @@
-MAN1_TXT=$(wildcard git-*.txt)
+MAN1_TXT=$(wildcard git-*.txt) gitk.txt
 MAN7_TXT=git.txt
 
 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
diff --git a/debian/git-tk.files b/debian/git-tk.files
--- a/debian/git-tk.files
+++ b/debian/git-tk.files
@@ -1 +1,3 @@
 /usr/bin/gitk
+/usr/share/man/man1/gitk.*
+/usr/share/doc/git-core/gitk.*

^ permalink raw reply

* [PATCH] git bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:00 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540042850-git-send-email-tv@debian.org>

Point Debian doc-base at the right files. Clean up.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit f4d2a91b2946330c4bf240cf73e64684cba43ddf
tree 8ccdaef874ab4161b7c22206672376fdfc338689
parent 62e16702fdb0cdc13822470f3a19b36956fd0d78
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:28 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:28 +0300

 debian/git-core.doc-base |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/git-core.doc-base b/debian/git-core.doc-base
--- a/debian/git-core.doc-base
+++ b/debian/git-core.doc-base
@@ -1,6 +1,5 @@
 Document: git-core
-Title: git-core
-Author: 
+Title: git reference
 Abstract: This manual describes git
 Section: Devel
 
@@ -9,4 +8,4 @@ Index: /usr/share/doc/git-core/git.html
 Files: /usr/share/doc/git-core/*.html
 
 Format: text
-Files: /usr/share/doc/git-core/git-core.txt
+Files: /usr/share/doc/git-core/git.txt*

^ permalink raw reply

* [PATCH] git bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:00 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen

Fix syntax error in debian Build-Depends-Indep, dpkg-checkbuilddeps used
to give false ok results.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit c87030106cfbe39f0ab2ed095f30f576235328fc
tree ca572653ccd5a4c35f9479c079c8a904d6fce2d1
parent 248542ea9ae9125a7ccf214b979ada9908ea1358
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:26 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:26 +0300

 debian/control |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: git-core
 Section: devel
 Priority: optional
 Maintainer: Junio C Hamano <junkio@cox.net>
-Build-Depends-Indep: libz-dev, libssl-dev, libcurl3-dev, asciidoc > 6.0.3, xmlto, debhelper (>= 4.0.0)
+Build-Depends-Indep: libz-dev, libssl-dev, libcurl3-dev, asciidoc (>= 6.0.3), xmlto, debhelper (>= 4.0.0)
 Standards-Version: 3.6.1
 
 Package: git-core

^ permalink raw reply

* [PATCH] git bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:00 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540041041-git-send-email-tv@debian.org>

Ignore generated files.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit de5b995a65645ecf09bfebff2ba7dc325979e4b3
tree 6a48d6719178c7e0d81cae7683e5b7294ee92781
parent 56bb91cb027a0e0dc8d896d26906597088ee6372
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:33 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:33 +0300

 .gitignore               |   51 ++++++++++++++++++++++++++++++++++++++++++++++
 Documentation/.gitignore |    5 +++++
 debian/.gitignore        |    6 +++++
 templates/.gitignore     |    1 +
 tools/.gitignore         |    2 ++
 5 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,51 @@
+git-apply
+git-build-rev-cache
+git-cat-file
+git-checkout-cache
+git-clone-pack
+git-commit-tree
+git-convert-cache
+git-daemon
+git-diff-cache
+git-diff-files
+git-diff-helper
+git-diff-stages
+git-diff-tree
+git-export
+git-fetch-pack
+git-fsck-cache
+git-get-tar-commit-id
+git-hash-object
+git-http-pull
+git-init-db
+git-local-pull
+git-ls-files
+git-ls-tree
+git-merge-base
+git-merge-cache
+git-mktag
+git-pack-objects
+git-patch-id
+git-peek-remote
+git-prune-packed
+git-read-tree
+git-receive-pack
+git-rev-list
+git-rev-parse
+git-rev-tree
+git-send-pack
+git-show-branch
+git-show-index
+git-show-rev-cache
+git-ssh-pull
+git-ssh-push
+git-stripspace
+git-tar-tree
+git-unpack-file
+git-unpack-objects
+git-update-cache
+git-update-server-info
+git-upload-pack
+git-var
+git-verify-pack
+git-write-tree
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
new file mode 100644
--- /dev/null
+++ b/Documentation/.gitignore
@@ -0,0 +1,5 @@
+*.xml
+*.html
+*.1
+*.7
+howto-index.txt
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1,6 @@
+git-core
+git-tk
+*.debhelper
+*.substvars
+build-stamp
+files
diff --git a/templates/.gitignore b/templates/.gitignore
new file mode 100644
--- /dev/null
+++ b/templates/.gitignore
@@ -0,0 +1 @@
+blt
diff --git a/tools/.gitignore b/tools/.gitignore
new file mode 100644
--- /dev/null
+++ b/tools/.gitignore
@@ -0,0 +1,2 @@
+git-mailinfo
+git-mailsplit

^ permalink raw reply

* [PATCH] git bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:00 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <1125054003873-git-send-email-tv@debian.org>

Make the git deb conflict with cogito versions prior to 0.13, as those
versions used to contain git. Suggest cogito.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 62e16702fdb0cdc13822470f3a19b36956fd0d78
tree bf96bcbdf1ca99390e6d6cb894da8384270c585f
parent c87030106cfbe39f0ab2ed095f30f576235328fc
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:27 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 12:32:27 +0300

 debian/control |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,8 @@ Package: git-core
 Architecture: any
 Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, patch, rcs
 Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl
-Conflicts: git
+Suggests: cogito
+Conflicts: git, cogito (<< 0.13)
 Description: The git content addressable filesystem
  GIT comes in two layers. The bottom layer is merely an extremely fast
  and flexible filesystem-based database designed to store directory trees

^ permalink raw reply

* [PATCH] cogito bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:01 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen

As cogito contains only shell scripts, make the deb Arch: all.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 0b1227b120532fe2d8b48ad2d43b2f002241f8d9
tree 1e00c450a8eb96159f0f5545ce94aabd3a1fcd44
parent 1190649aaff433501d6e6c92deb8a0f201fdd8d0
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:00 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:00 +0300

 debian/control |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -6,8 +6,8 @@ Build-Depends: debhelper (>= 4.0.0), dpa
 Standards-Version: 3.6.1
 
 Package: cogito
-Architecture: any
-Depends: git-core, ${shlibs:Depends}, patch, diff, rcs
+Architecture: all
+Depends: git-core, patch, diff, rcs
 Recommends: rsync, curl, wget, rsh-client
 Conflicts: cgvg
 Description: version control system

^ permalink raw reply

* [PATCH] cogito bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:01 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540944027-git-send-email-tv@debian.org>

As long as the cg-cancel name is around, provide docs for it too.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit c1970992d81e2c26d2d85ad65b0e2e90fbeee7f1
tree 461b478052898b2d9cfc67a1b29098abdf5d427e
parent 97b501908e075bfd1f97261f94842669e7b4db5b
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:03 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:03 +0300

 Documentation/Makefile |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,7 +1,7 @@
 CG_IGNORE=$(wildcard ../cg-X* ../cg-*.orig ../cg-*.rej)
 CG_SRC=$(filter-out $(CG_IGNORE), $(wildcard ../cg-*))
 
-MAN1_TXT=$(patsubst ../cg-%,cg-%.txt,$(CG_SRC))
+MAN1_TXT=$(patsubst ../cg-%,cg-%.txt,$(CG_SRC)) cg-cancel.txt
 MAN7_TXT=cogito.txt
 
 DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT)) introduction.html
@@ -71,3 +71,9 @@ cogito.txt : make-cogito-asciidoc
 
 cg-%.txt : ../cg-% make-cg-asciidoc
 	./make-cg-asciidoc $< > $@
+
+cg-cancel.txt : cg-reset.txt
+	ln -s $< $@
+
+cg-cancel.1 : cg-reset.1
+	ln -s $< $@

^ permalink raw reply

* [PATCH] cogito bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:01 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540952491-git-send-email-tv@debian.org>

Make the text format docs too.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 3a0094e4985bcb5970ecee2d59d0ba5f5a806d2d
tree b4d3b267a4b15d3068727fad080c12f6d10a6cd9
parent 91aeeed108292bb42f7b133da13ec6881cf84a9e
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:09 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:09 +0300

 Documentation/Makefile |    4 +++-
 debian/rules           |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -29,7 +29,7 @@ INSTALL=install
 # yourself - yes, all 6 characters of it!
 #
 
-all: html man
+all: html man txt
 
 html: $(DOC_HTML)
 
@@ -38,6 +38,8 @@ man: man1 man7
 man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
+txt: $(MAN1_TXT) $(MAN7_TXT)
+
 install: man
 	$(INSTALL) -m755 -d $(DESTDIR)/$(txtdir)
 	$(INSTALL) $(MAN1_TXT) $(MAN7_TXT) $(DESTDIR)/$(txtdir)
diff --git a/debian/rules b/debian/rules
--- a/debian/rules
+++ b/debian/rules
@@ -48,7 +48,7 @@ build: build-stamp
 build-stamp: configure-stamp 
 	dh_testdir
 	$(MAKE)
-	$(MAKE) -C Documentation html man
+	$(MAKE) -C Documentation all
 	touch build-stamp
 
 clean:

^ permalink raw reply

* [PATCH] cogito bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:01 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540943597-git-send-email-tv@debian.org>

Stylistical improvements on Debian package description.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 97b501908e075bfd1f97261f94842669e7b4db5b
tree ee48eaa9d8fbf6db7c2a19cfd93de52d60938655
parent 0b1227b120532fe2d8b48ad2d43b2f002241f8d9
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:02 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:02 +0300

 debian/control |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/debian/control b/debian/control
--- a/debian/control
+++ b/debian/control
@@ -10,8 +10,8 @@ Architecture: all
 Depends: git-core, patch, diff, rcs
 Recommends: rsync, curl, wget, rsh-client
 Conflicts: cgvg
-Description: version control system
- Cogito is a version control system layered on top of the git tree history
- storage system. It aims at seamless user interface and ease of use, providing
- generally smoother user experience than the "raw" Core GIT itself and indeed
- many other version control systems.
+Description: A version control system layered on top of git
+ A version control system layered on top of the git tree history
+ storage system. It aims at seamless user interface and ease of use,
+ providing generally smoother user experience than the "raw" Core GIT
+ itself and indeed many other version control systems.

^ permalink raw reply

* [PATCH] cogito bugfixes and cleanups, mainly Debian things
From: Tommi Virtanen @ 2005-08-26 11:01 UTC (permalink / raw)
  To: git; +Cc: Tommi Virtanen
In-Reply-To: <11250540952285-git-send-email-tv@debian.org>

Ignore more generated files.

Signed-off-by: Tommi Virtanen <tv@debian.org>

---
commit 91aeeed108292bb42f7b133da13ec6881cf84a9e
tree fd0dc430a655fde2a21a9634c914b22db0ee96ce
parent c1970992d81e2c26d2d85ad65b0e2e90fbeee7f1
author Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:07 +0300
committer Tommi Virtanen <tv@debian.org> Fri, 26 Aug 2005 13:34:07 +0300

 .gitignore               |    2 ++
 Documentation/.gitignore |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
 cg-version
+build-stamp
+configure-stamp
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -1,2 +1,3 @@
 *.html
 cogito.txt
+*.[1-9]

^ permalink raw reply

* [PATCH] gitweb - XMMS2 project customisations
From: Sham Chukoury @ 2005-08-26 11:16 UTC (permalink / raw)
  To: Git Mailing List

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

G'day.

I figured you folks might be interested in a number of modifications the 
XMMS2 team have made to gitweb. All the changes can be seen at 
http://git.xmms.se

1) Navbar refactoring (gitweb-xmms2navbar.diff)
The original idea was to add a link to our snapshots directory, in the 
navigation bar at the top of every gitweb page. The problem was that the 
code for producing the navbar HTML was mostly duplicated in various 
different places. I refactored the code so that a single 'git_navbar' 
subroutine is called every time gitweb needs a navbar. The patch itself 
probably needs some cleaning up: 1) I omitted the git_navbar call in one 
place, as the original navbar code there didn't look like the navbar 
code in other places, 2) there's a 'snapshot link' in the navbar which 
won't work unless gitweb-xmms2snapshots.diff is also applied 
($snapshots_url isn't defined in gitweb-xmms2navbar.diff)

2) Commit tags support (gitweb-xmms2committags.diff)
We originally started using specific commit tags during the development 
of XMMS2 to facilitate the generation of changelogs at every release. 
This patch reformats commit descriptions containing 'BUG' or 'FEATURE' 
to produce hyperlinks to bug reports on our mantis bug tracker 
(http://bugs.xmms2.xmms.se), as well as linking to release information 
pages ('RELEASE' tag). You could adapt this patch to provide support for 
other custom tags. It might also be possible to cleverly integrate the 
committags and committags_shortlog subroutines into a single 
subroutine.. I couldn't figure it out easily enough - my 
Perl(+regexp)-fu isn't strong enough. ;)

3) Snapshot integration (gitweb-xmms2snapshots.diff & snapshot.cgi)
This patch makes it possible to easily produce snapshots of every commit 
in a git tree. Hyperlinks to 'snapshot' or 'latest snapshot' are added 
in various places. All you need is to have a CGI script to handle the 
request, with 'tree' and 'commit' parameters, where 'tree' refers to a 
git tree/repository and 'commit' is either a commit hash or 'HEAD'. I'm 
also attaching snapshot.cgi, the Python script we use to automagically 
generate and serve snapshot tarballs, as reference.

Hope someone finds these useful.. ;)
Cheers
-S

[-- Attachment #2: gitweb-xmms2committags.diff --]
[-- Type: text/plain, Size: 3606 bytes --]

--- ../gitweb/gitweb.cgi	2005-08-25 19:25:11.000000000 +0800
+++ gitweb.cgi	2005-08-25 20:33:50.000000000 +0800
@@ -40,6 +40,23 @@
 #my $projects_list = $projectroot;
 my $projects_list = "index/index.aux";
 
+# custom stuff - mantis/commit tags integration
+sub committags($){
+	my $a = shift;
+	$a =~ s!BUG\(([0-9]*)\)!<a href="http://bugs.xmms2.xmms.se/view.php?id=$1">BUG($1)</a>!g;
+	$a =~ s!FEATURE\(([0-9]*)\)!<a href="http://bugs.xmms2.xmms.se/view.php?id=$1">FEATURE($1)</a>!g;
+	$a =~ s!RELEASE: (.*)!RELEASE: <a href="http://wiki.xmms2.xmms.se/index.php/Release:$1">$1</a>!g;
+	return $a;
+}
+sub committags_shortlog($$){
+	my $a = shift;
+	my $href = shift;
+	$a =~ s!BUG\(([0-9]*)\)!</a><a href="http://bugs.xmms2.xmms.se/view.php?id=$1">BUG($1)</a><a class=\"list\" href=\"$href\">!g;
+	$a =~ s!FEATURE\(([0-9]*)\)!</a><a href="http://bugs.xmms2.xmms.se/view.php?id=$1">FEATURE($1)</a><a class=\"list\" href=\"$href\">!g;
+	$a =~ s!RELEASE: (.*)!RELEASE: <a href="http://wiki.xmms2.xmms.se/index.php/Release:$1">$1</a>!g;
+	return $a;
+}
+
 # input validation and dispatch
 my $action = $cgi->param('a');
 if (defined $action) {
@@ -655,7 +672,7 @@
 			$line =~ s/$hash_text/$link/;
 		}
 	}
-	return $line;
+	return committags($line);
 }
 
 sub date_str {
@@ -979,7 +996,7 @@
 			      "<td><i>" . escapeHTML(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
 			      "<td>" .
 			      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"},
-			      "<b>" . escapeHTML($co{'title_short'}) . "</b>") .
+			      "<b>" . committags_shortlog(escapeHTML($co{'title_short'}), "$my_uri?p=$project;a=commit;h=$commit") . "</b>") .
 			      "</td>\n" .
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
@@ -1977,7 +1994,7 @@
 	      "<br/><br/>\n" .
 	      "</div>\n";
 	print "<div>\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
+	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, committags(escapeHTML($co{'title'}))) . "\n" .
 	      "</div>\n";
 	print "<div class=\"page_path\"><b>/$file_name</b><br/></div>\n";
 
@@ -2004,7 +2021,7 @@
 			print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
 			      "<td><i>" . escapeHTML(chop_str($co{'author_name'}, 15, 3)) . "</i></td>\n" .
 			      "<td>" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "<b>" .
-			      escapeHTML(chop_str($co{'title'}, 50)) . "</b>") . "</td>\n" .
+			      committags(escapeHTML(chop_str($co{'title'}, 50))) . "</b>") . "</td>\n" .
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
 			      " | " . $cgi->a({-href => "$my_uri?p=$project;a=blob;hb=$commit;f=$file_name"}, "blob");
@@ -2230,7 +2247,7 @@
 		print "<td title=\"$co{'age_string_age'}\"><i>$co{'age_string_date'}</i></td>\n" .
 		      "<td><i>" . escapeHTML(chop_str($co{'author_name'}, 10)) . "</i></td>\n" .
 		      "<td>" . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit", -class => "list"}, "<b>" .
-		      escapeHTML($co{'title_short'}) . "</b>") . "</td>\n" .
+		      committags_shortlog(escapeHTML($co{'title_short'}), "$my_uri?p=$project;a=commit;h=$commit") . "</b>") . "</td>\n" .
 		      "<td class=\"link\">" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
 		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .

[-- Attachment #3: gitweb-xmms2navbar.diff --]
[-- Type: text/plain, Size: 15248 bytes --]

--- ../gitweb/gitweb.cgi	2005-08-25 19:25:11.000000000 +0800
+++ gitweb.cgi	2005-08-26 17:56:41.000000000 +0800
@@ -40,6 +40,53 @@
 #my $projects_list = $projectroot;
 my $projects_list = "index/index.aux";
 
+# custom stuff - refactored navbar
+sub git_navbar($$$$) {
+	my $project = shift;
+	my $head = shift;
+	my $curSection = shift;
+	my $extraLinks = shift;
+
+	my $sumLink = $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary");
+	my $slogLink = $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog");
+	my $logLink = $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log");
+	my $comLink = $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit");
+	my $comdifLink = $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff");
+	my $treeLink = $cgi->a({-href => "$my_uri?p=$project;a=tree"}, "tree");
+	my $snapLink = $cgi->a({-href => "$snapshots_url?tree=$project&commit=HEAD"}, "latest snapshot");
+
+	if ($curSection eq "summary") {
+		$sumLink = "summary";
+	}
+	elsif ($curSection eq "shortlog") {
+		$slogLink = "shortlog";
+	}
+	elsif ($curSection eq "log") {
+		$logLink = "log";
+	}
+	elsif ($curSection eq "commit") {
+		$comLink = "commit";
+	}
+	elsif ($curSection eq "commitdiff") {
+		$comdifLink = "commitdiff";
+	}
+	elsif ($curSection eq "tree") {
+		$treeLink = "tree";
+	}
+
+	my $retVal = "<div class=\"page_nav\">\n" .
+	      $sumLink .
+	      " | " . $slogLink .
+	      " | " . $logLink .
+	      " | " . $comLink .
+	      " | " . $comdifLink .
+	      " | " . $treeLink .
+	      " | " . $snapLink .
+	      "<br/>$extraLinks<br/>\n" .
+	      "</div>\n";
+	return $retVal;
+}
+
 # input validation and dispatch
 my $action = $cgi->param('a');
 if (defined $action) {
@@ -941,15 +988,7 @@
 	}
 
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      "summary".
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree"}, "tree") .
-	      "<br/><br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $head, "summary", "");
 	print "<div class=\"title\">&nbsp;</div>\n";
 	print "<table cellspacing=\"0\">\n" .
 	      "<tr><td>description</td><td>" . escapeHTML($descr) . "</td></tr>\n" .
@@ -1087,15 +1126,7 @@
 sub git_tag {
 	my $head = git_read_hash("$project/HEAD");
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;hb=$head"}, "tree") . "<br/>\n" .
-	      "<br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $head, "tag", "");
 	my %tag = git_read_tag($hash);
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML($tag{'name'})) . "\n" .
@@ -1126,15 +1157,7 @@
 sub git_tags {
 	my $head = git_read_hash("$project/HEAD");
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;hb=$head"}, "tree") . "<br/>\n" .
-	      "<br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $head, "tags", "");
 	my $taglist = git_read_refs("refs/tags");
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, "&nbsp;") .
@@ -1185,15 +1208,7 @@
 sub git_branches {
 	my $head = git_read_hash("$project/HEAD");
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$head"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$head"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;hb=$head"}, "tree") . "<br/>\n" .
-	      "<br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $head, "branches", "");
 	my $taglist = git_read_refs("refs/heads");
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, "&nbsp;") .
@@ -1263,15 +1278,7 @@
 	my $base = $file_name || "";
 	git_header_html();
 	if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
-		print "<div class=\"page_nav\">\n" .
-		      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree") . "<br/>\n";
-		print $cgi->a({-href => "$my_uri?p=$project;a=blob_plain;h=$hash"}, "plain") . "<br/>\n" .
-		      "</div>\n";
+		print git_navbar($project, $hash_base, "blob", $cgi->a({-href => "$my_uri?p=$project;a=blob_plain;h=$hash"}, "plain"));
 		print "<div>" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML($co{'title'})) .
 		      "</div>\n";
@@ -1331,15 +1338,7 @@
 	my $base = "";
 	if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
 		$base_key = ";hb=$hash_base";
-		print "<div class=\"page_nav\">\n" .
-		      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash_base"}, "shortlog") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash_base"}, "log") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
-		      " | tree" .
-		      "<br/><br/>\n" .
-		      "</div>\n";
+		print git_navbar($project, $hash_base, "tree", "");
 		print "<div>\n" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
 		      "</div>\n";
@@ -1493,38 +1492,31 @@
 		$page = 0;
 	}
 	git_header_html();
-	print "<div class=\"page_nav\">\n";
-	print $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash"}, "shortlog") .
-	      " | log" .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$hash;hb=$hash"}, "tree") . "<br/>\n";
 
+	my $navExtra = "";
 	my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
 	open my $fd, "-|", "$gitbin/git-rev-list $limit $hash" or die_error(undef, "Open failed.");
 	my (@revlist) = map { chomp; $_ } <$fd>;
 	close $fd;
 
 	if ($hash ne $head || $page) {
-		print $cgi->a({-href => "$my_uri?p=$project;a=log"}, "HEAD");
+		$navExtra .= $cgi->a({-href => "$my_uri?p=$project;a=log"}, "HEAD");
 	} else {
-		print "HEAD";
+		$navExtra .= "HEAD";
 	}
 	if ($page > 0) {
-		print " &sdot; " .
+		$navExtra .= " &sdot; " .
 		$cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash;pg=" . ($page-1), -accesskey => "p", -title => "Alt-p"}, "prev");
 	} else {
-		print " &sdot; prev";
+		$navExtra .= " &sdot; prev";
 	}
 	if ($#revlist >= (100 * ($page+1)-1)) {
-		print " &sdot; " .
+		$navExtra .= " &sdot; " .
 		$cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash;pg=" . ($page+1), -accesskey => "n", -title => "Alt-n"}, "next");
 	} else {
-		print " &sdot; next";
+		$navExtra .= " &sdot; next";
 	}
-	print "<br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $hash, "log", $navExtra);
 	if (!@revlist) {
 		print "<div>\n" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, "&nbsp;") .
@@ -1593,6 +1585,7 @@
 	@difftree = map { chomp; $_ } <$fd>;
 	close $fd or die_error(undef, "Reading diff-tree failed.");
 	git_header_html();
+	# git_navbar omitted here - commitdiff link a bit weird o_O
 	print "<div class=\"page_nav\">\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
 	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash"}, "shortlog") .
@@ -1773,16 +1766,7 @@
 	mkdir($git_temp, 0700);
 	git_header_html();
 	if (defined $hash_base && (my %co = git_read_commit($hash_base))) {
-		print "<div class=\"page_nav\">\n" .
-		      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base"}, "commit") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash_base"}, "commitdiff") .
-		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash_base"}, "tree") .
-		      "<br/>\n";
-		print $cgi->a({-href => "$my_uri?p=$project;a=blobdiff_plain;h=$hash;hp=$hash_parent"}, "plain") .
-		      "</div>\n";
+		print git_navbar($project, $hash_base, "blobdiff", $cgi->a({-href => "$my_uri?p=$project;a=blobdiff_plain;h=$hash;hp=$hash_parent"}, "plain"));
 		print "<div>\n" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash_base", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
 		      "</div>\n";
@@ -1825,15 +1809,7 @@
 	close $fd or die_error(undef, "Reading diff-tree failed.");
 
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
-	      " | commitdiff" .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") . "<br/>\n";
-	print $cgi->a({-href => "$my_uri?p=$project;a=commitdiff_plain;h=$hash;hp=$hash_parent"}, "plain") . "\n" .
-	      "</div>\n";
+	print git_navbar($project, $hash, "commitdiff", $cgi->a({-href => "$my_uri?p=$project;a=commitdiff_plain;h=$hash;hp=$hash_parent"}, "plain"));
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
 	      "</div>\n";
@@ -1967,15 +1943,7 @@
 		die_error(undef, "Unknown commit object.");
 	}
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") .
-	      "<br/><br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $hash, "history", "");
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
 	      "</div>\n";
@@ -2051,15 +2019,7 @@
 		$pickaxe_search = 1;
 	}
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary;h=$hash"}, "summary") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "shortlog") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$co{'tree'};hb=$hash"}, "tree") .
-	      "<br/><br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $hash, "search", "");
 
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash", -class => "title"}, escapeHTML($co{'title'})) . "\n" .
@@ -2180,38 +2140,31 @@
 		$page = 0;
 	}
 	git_header_html();
-	print "<div class=\"page_nav\">\n" .
-	      $cgi->a({-href => "$my_uri?p=$project;a=summary"}, "summary") .
-	      " | shortlog" .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$hash"}, "log") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$hash"}, "commit") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$hash"}, "commitdiff") .
-	      " | " . $cgi->a({-href => "$my_uri?p=$project;a=tree;h=$hash;hb=$hash"}, "tree") . "<br/>\n";
 
 	my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
 	open my $fd, "-|", "$gitbin/git-rev-list $limit $hash" or die_error(undef, "Open failed.");
 	my (@revlist) = map { chomp; $_ } <$fd>;
 	close $fd;
 
+	my $navExtra = "";
 	if ($hash ne $head || $page) {
-		print $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "HEAD");
+		$navExtra .= $cgi->a({-href => "$my_uri?p=$project;a=shortlog"}, "HEAD");
 	} else {
-		print "HEAD";
+		$navExtra .= "HEAD";
 	}
 	if ($page > 0) {
-		print " &sdot; " .
+		$navExtra .= " &sdot; " .
 		$cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash;pg=" . ($page-1), -accesskey => "p", -title => "Alt-p"}, "prev");
 	} else {
-		print " &sdot; prev";
+		$navExtra .= " &sdot; prev";
 	}
 	if ($#revlist >= (100 * ($page+1)-1)) {
-		print " &sdot; " .
+		$navExtra .= " &sdot; " .
 		$cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$hash;pg=" . ($page+1), -accesskey => "n", -title => "Alt-n"}, "next");
 	} else {
-		print " &sdot; next";
+		$navExtra .= " &sdot; next";
 	}
-	print "<br/>\n" .
-	      "</div>\n";
+	print git_navbar($project, $hash, "shortlog", $navExtra);
 	print "<div>\n" .
 	      $cgi->a({-href => "$my_uri?p=$project;a=summary", -class => "title"}, "&nbsp;") .
 	      "</div>\n";

[-- Attachment #4: gitweb-xmms2snapshots.diff --]
[-- Type: text/plain, Size: 3500 bytes --]

--- ../gitweb/gitweb.cgi	2005-08-25 19:25:11.000000000 +0800
+++ gitweb.cgi	2005-08-26 17:50:57.000000000 +0800
@@ -40,6 +40,8 @@
 #my $projects_list = $projectroot;
 my $projects_list = "index/index.aux";
 
+my $snapshots_url = "http://git.xmms.se/snapshot.cgi";
+
 # input validation and dispatch
 my $action = $cgi->param('a');
 if (defined $action) {
@@ -845,6 +847,7 @@
 		      $cgi->a({-href => "$my_uri?p=$pr->{'path'};a=summary"}, "summary") .
 		      " | " . $cgi->a({-href => "$my_uri?p=$pr->{'path'};a=shortlog"}, "shortlog") .
 		      " | " . $cgi->a({-href => "$my_uri?p=$pr->{'path'};a=log"}, "log") .
+		      " | " . $cgi->a({-href => "$snapshots_url?tree=$pr->{'path'}&commit=HEAD"}, "latest snapshot") .
 		      "</td>\n" .
 		      "</tr>\n";
 	}
@@ -984,6 +987,7 @@
 			      "<td class=\"link\">" .
 			      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
 			      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .
+			      " | " . $cgi->a({-href => "$snapshots_url?tree=$project&commit=$commit"}, "snapshot") .
 			      "</td>\n" .
 			      "</tr>";
 		} else {
@@ -1033,7 +1037,8 @@
 				print $cgi->a({-href => "$my_uri?p=$project;a=$tag{'reftype'};h=$tag{'refid'}"}, $tag{'reftype'});
 				if ($tag{'reftype'} eq "commit") {
 				      print " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$tag{'name'}"}, "shortlog") .
-				            " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'refid'}"}, "log");
+				            " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'refid'}"}, "log") .
+				            " | " . $cgi->a({-href => "$snapshots_url?tree=$project&commit=$tag{'refid'}"}, "snapshot");
 				}
 				print "</td>\n" .
 				      "</tr>";
@@ -1172,7 +1177,8 @@
 			print $cgi->a({-href => "$my_uri?p=$project;a=$tag{'reftype'};h=$tag{'refid'}"}, $tag{'reftype'});
 			if ($tag{'reftype'} eq "commit") {
 			      print " | " . $cgi->a({-href => "$my_uri?p=$project;a=shortlog;h=$tag{'name'}"}, "shortlog") .
-			            " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'refid'}"}, "log");
+			            " | " . $cgi->a({-href => "$my_uri?p=$project;a=log;h=$tag{'refid'}"}, "log") .
+			            " | " . $cgi->a({-href => "$snapshots_url?tree=$project&commit=$tag{'refid'}"}, "snapshot");
 			}
 			print "</td>\n" .
 			      "</tr>";
@@ -1545,6 +1551,7 @@
 		      "<div class=\"log_link\">\n" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
 		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .
+		      " | " . $cgi->a({-href => "$snapshots_url?tree=$project&commit=$commit"}, "snapshot") .
 		      "<br/>\n" .
 		      "</div>\n" .
 		      "<i>" . escapeHTML($co{'author_name'}) .  " [$ad{'rfc2822'}]</i><br/>\n" .
@@ -1646,6 +1653,8 @@
 		      "</td>" .
 		      "</tr>\n";
 	}
+	print "<tr><td>snapshot</td>".
+	      "<td><a href=\"$snapshots_url?tree=$project&commit=$hash\">$hash</a></td></tr>";
 	print "</table>". 
 	      "</div>\n";
 	print "<div class=\"page_body\">\n";
@@ -2234,6 +2243,7 @@
 		      "<td class=\"link\">" .
 		      $cgi->a({-href => "$my_uri?p=$project;a=commit;h=$commit"}, "commit") .
 		      " | " . $cgi->a({-href => "$my_uri?p=$project;a=commitdiff;h=$commit"}, "commitdiff") .
+		      " | " . $cgi->a({-href => "$snapshots_url?tree=$project&commit=$commit"}, "snapshot") .
 		      "</td>\n" .
 		      "</tr>";
 	}

[-- Attachment #5: snapshot.cgi --]
[-- Type: application/x-cgi, Size: 6516 bytes --]

^ permalink raw reply

* Re: [PATCH] gitweb - XMMS2 project customisations
From: Sven Verdoolaege @ 2005-08-26 11:32 UTC (permalink / raw)
  To: Sham Chukoury; +Cc: Git Mailing List
In-Reply-To: <430EF9F5.70003@xmms.org>

On Fri, Aug 26, 2005 at 07:16:05PM +0800, Sham Chukoury wrote:
> G'day.
> 
> I figured you folks might be interested in a number of modifications the 
> XMMS2 team have made to gitweb. All the changes can be seen at 
> http://git.xmms.se
> 
> 1) Navbar refactoring (gitweb-xmms2navbar.diff)
> 3) Snapshot integration (gitweb-xmms2snapshots.diff & snapshot.cgi)

I've sent similar patches to the git mailing list almost two
months ago, but Kay didn't take them.
Maybe you could compare with my version

http://www.liacs.nl/~sverdool/gitweb.cgi?p=gitweb.git;a=summary

(I'll be mostly offline for the next couple of days.)

skimo

^ permalink raw reply

* Re: [PATCH] Fix pulling into the same branch.
From: Johannes Schindelin @ 2005-08-26 13:04 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Tony Luck, Linus Torvalds
In-Reply-To: <7vr7chmqop.fsf_-_@assigned-by-dhcp.cox.net>

Hi,

On Thu, 25 Aug 2005, Junio C Hamano wrote:

> This patch is to show my current thinking.  Please let me know
> what you think.

I like it. As Linus stated, the index originally had a different role from 
what it has now, so it really should be an internal git thing, i.e. the 
git user should not expect the index not to change when pulling.

Ciao,
Dscho

^ permalink raw reply

* Re: Storing state in $GIT_DIR
From: Eric W. Biederman @ 2005-08-26 14:26 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Linus Torvalds, GIT, Junio C Hamano
In-Reply-To: <46a038f90508260008d1013ea@mail.gmail.com>

Martin Langhoff <martin.langhoff@gmail.com> writes:

> On 8/26/05, Eric W. Biederman <ebiederm@xmission.com> wrote:
>> Thinking about it going from arch to git should be just a matter
>> of checking sha1 hashes, possibly back to the beginning of the
>> arch tree.
>
> Yup, though actually replaying the tree to compute the hashes is
> something I just _won't_ do ;)

I guess if you have the tla branch names it won't be necessary.
If you are careful how you do the import you can have two parallel
imports of the same data and produce exactly the same git tree.
That is largely why I care about a stable algorithm for the hashes.

>> Going from git to arch is the trickier mapping, because you
>> need to know the full repo--category--branch--version--patch
>> mapping.
>
> My plan doesn't include git->arch support... yet...

One of my interests, and if I get the time to worry about it
is to get a scm that is a sufficient superset of what other
scms do so it can serve as a bidirectional gateway.

git is fairly close to what is needed to implement that.

Hmm.  I wonder if a git metadata branch in general is sufficient to
store information that does not map to git natively?

>> Hmm.  Thinking about arch from a git perspective arch tags every
>> commit.  So the really sane thing to do (I think) is to create
>> a git tag object for every arch commit.
>
> Now I like that interesting idea. It doesn't solve all my problems,
> but is a reasonable mapping point. Will probably do it.
>
>> With patch trading (Martin I think I know what you are refering to)
>> arch does seem to have a concept that does not map very well to git,
>> and this I think is a failing in git.
>
> I won't get into _that_ flamewar ;)

<pouts> No flamewar </pouts>

> My plan for merges is to detect when two branches up until what point
> branches are fully merged, and mark that in git -- because that is
> what git considers a merge. The rest will be known to the importer,
> but nothing else.

I looked at least back to the StGit announcement and it helped to
clarify my thinking.  A patch is equivalent to a branch with
just one change. This makes cherry picking a single patch roughly
equivalent to describing that patch as a single commit branch
at the fork point from the common ancestor of the two branches,
and then having the single commit merged.

The fact that the original branch that was cherry picked from
can really only be represented as a an graft.  Like the original
linux kernel history.

The shortcoming I see in git-applypatch is that it doesn't attempt
to find the original base of a patch and instead simply assumes it
is against the current tree.

There is a similar short coming in git-diff-tree where it reports
the commit that you are on when take the diff, but it does not
report the commit the diff is against. 

......

Thinking a little more there is also a connection with reverting
patches.  Cherry picking changes from a branch may also be thought of
as reverting all of the other changes from a branch and then merging
the branch.

The practical impact of all of these things is there a form that
will allow future merges to realize the same change has already
been applied so it can skip it the second time.

Inter-operating with darcs, tla, quilt, and raw diff/patch brings up
these issues.

So my practical questions are:
- What information can a current git merge algorithms and more
  sophisticated merge algorithms use to avoid having conflicts when
  the same changes are merged into the same branch multiple times?

- Is the git meta data sufficient to represent the history
  sophisticated merge algorithms can use.

- Is the git meta data sufficient to represent the result
  of sufficient meta data operations.

- Is the current representation of a reverted change sufficient
  for the merge algorithms, or could they do a better job if
  they new a change was revert of a previous change.

I'm just trying to think through the issues that working with patch
based systems bring up.

Eric

^ permalink raw reply

* Re: [ANNOUNCE] GIT 0.99.5
From: Eric W. Biederman @ 2005-08-26 15:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vr7ci4u7q.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> writes:

> Documentation
> -------------


A nit but possibly an important for 1.0 there are
quite a few git commands that don't have man pages
or whose man pages are currently very poor.

Getting the code sane and stable of course comes first
but if people can't figure out how to use git...

Eric

^ permalink raw reply

* Re: [RFC] Looking at multiple ancestors in merge
From: Daniel Barkalow @ 2005-08-26 15:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwtm9f3me.fsf@assigned-by-dhcp.cox.net>

On Fri, 26 Aug 2005, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > I've started this, and have gotten as far as having read-tree accept > 3
> > trees and ignore everything but the last 3. Am I correct in assuming that
> > if I break read-tree in any way, some test will fail?
>
> If some test fails you would know you broke it, but the inverse
> is probably not always true.
>
> I think the current read-tree test suite has reasonably wide
> coverage of all the interesting cases.  But the definition of
> "interesting" was derived from the current world order (IOW, the
> test suite was designed around the way we do things right now as
> a whitebox test, not a blackbox test).  I would not be surprised
> if some of them did not catch breakage you may introduce during
> the development.

Okay; I think the only thing that I'm going to change with respect to how
it makes decisions will be with 4+ trees, and those will obviously need
new tests,

> I wonder however if extending the current way of doing things in
> the cache is the right thing.  Right now we use two bits out of
> the top four bits for recording stage, one bit for the update
> bit, so you have only one extra bit to extend the number of
> stages, which means you could hold at most 7 trees at once.
>
> You "ignore things but the last 3", so this may not be too much
> of a problem, but I am a bit puzzled what you meant by it
> though.  Are you talking about reading more than 3 trees and
> keeping only the 3 to be merged, discarding the rest, doing the
> selection per path?

For each path, I intend to look at all the entries and make trivial merge
judgements on them, but then only leave the usual stage 2 and stage 3, and
a chosen stage 1. The way I'm writing the changes is:

In the argument parsing loop, just form a list of the tree objects, and
actually read them after the whole list is ready. If there are more than
3, ignore all but the last 3. This lets you give an arbitary number of
common ancestors to read-tree, and it won't mess up, but it will only use
one of them. I've done this.

Next, scan through the tree entry lists for all the trees together, and
generate cache entries for the same path in the different trees at the
same time. I've written this, but I've got a few bugs, and the 3way merge
tests are dutifully failing.

Then, I'll do the trivial merge on tree entries rather than cache
entries.

Finally, I'll extend the trivial merge to use the extra ancestors.

Since merge(1) doesn't handle multiple common ancestors, having more than
3 stages in the cache after the trivial merge isn't going to be useful for
now.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply

* Re: [ANNOUNCE] GIT 0.99.5
From: Junio C Hamano @ 2005-08-26 16:24 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: git
In-Reply-To: <m1y86ospej.fsf@ebiederm.dsl.xmission.com>

ebiederm@xmission.com (Eric W. Biederman) writes:

> A nit but possibly an important for 1.0 there are
> quite a few git commands that don't have man pages
> or whose man pages are currently very poor.
>
> Getting the code sane and stable of course comes first
> but if people can't figure out how to use git...

I have been worried about that since I posted my first "last
mile" message.  My excuse is that there are only 24 hours in a
day.  Patches welcome.

^ permalink raw reply

* Re: Merges without bases
From: Daniel Barkalow @ 2005-08-26 16:37 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Junio C Hamano, Darrin Thompson, git
In-Reply-To: <46a038f905082602176f9eef5d@mail.gmail.com>

On Fri, 26 Aug 2005, Martin Langhoff wrote:

> On 8/26/05, Junio C Hamano <junkio@cox.net> wrote:
> > their core GIT tools come from.  But how would _I_ pull from
> > that "My Project", if I did not want to pull unrelated stuff in?
>
> and then...
>
> > What I think _might_ deserve a bit more support would be a merge
> > of a foreign project as a subdirectory of a project.  Linus
>
> tla has an interesting implementation (and horrible name) for
> something like this. In Arch-speak, they are called 'configurations',
> a versioned control file that describes that in subdirectory foo we
> import from this other repo#branch.
>
> In cvs, you just do nested checkouts, and trust a `cvs update` done at
> the top will do the right thing;  and in fact recent cvs versions do.

The problem with both of these (and doing it in the build system) is that,
when a project includes another project, you generally don't want whatever
revision of the included project happens to be the latest; you want the
revision of the included project that the revision of the including
project you're looking at matches. That is, if App includes Lib, and
you're looking at an App commit, you want to have the version of Lib that
the commit was made with, not the latest version of Lib, which may not be
backwards compatible across non-release commits, or, in any case, won't
help in reconstructing a earlier state. I think a primary function of a
SCM is to be able to say, "It worked last Friday, and it's broken now.
What's different?" If the answer is, "On Saturday, we updated the
included Lib to their version from Thursday, which is broken", it'll be
really hard to track down without special tracking.

I think it's the lack of the special tracking, therefore, that makes this
not a good feature in most SCMs, and makes them not better than having the
build system do it (and potentially worse, if you've got your build system
checking out a version specified in a version-controlled file). But I
think that git can do better, including support for the required version
sometimes being a locally modified one and sometimes being the official
one when the local modifications have been accepted upstream.

	-Daniel
*This .sig left intentionally blank*

^ 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