From 306fc124621657234b21dce542496440d53147a6 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 22 May 2007 03:22:51 -0400 Subject: [PATCH 01/11] git-gui: Tighten internal pattern match for lib/ directory Our GITGUI_LIBDIR macro was testing only for @@ at the start of the path, assuming nobody would ever find that to be a reasonable prefix for a directory to install our library into. That is most likely a valid assumption, but its even more unlikely they would have the start be @@GITGUI_ and the end be @@. Note that we cannot use the full string here because that would get expanded by the sed replacement in our Makefile. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-gui.sh b/git-gui.sh index 0a471a5c7d..40f54e4dab 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA} ## configure our library set oguilib {@@GITGUI_LIBDIR@@} -if {[string match @@* $oguilib]} { +if {[string match @@GITGUI_*@@ $oguilib]} { set oguilib [file join [file dirname [file normalize $argv0]] lib] } set idx [file join $oguilib tclIndex] From 3d5793bf52223ccec40aff2839a3c5bad96bca8b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Thu, 24 May 2007 02:33:13 -0400 Subject: [PATCH 02/11] Correct key bindings to Control- Alberto Bertogli reported on #git that git-gui was exiting with alt-q, while gitk on the same system was exiting with ctrl-q. That was not what I wanted. I really wanted M1B to be bound to the Control key on most non-Mac OS X platforms, but according to Sam Vilain M1 on most systems means alt. Since gitk always does control, I'm doing the same thing for all non-Mac OS X systems. Signed-off-by: Shawn O. Pearce --- git-gui.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/git-gui.sh b/git-gui.sh index 40f54e4dab..cfc4c7f686 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -1206,15 +1206,12 @@ foreach class {Button Checkbutton Entry Label } unset class -if {[is_Windows]} { - set M1B Control - set M1T Ctrl -} elseif {[is_MacOSX]} { +if {[is_MacOSX]} { set M1B M1 set M1T Cmd } else { - set M1B M1 - set M1T M1 + set M1B Control + set M1T Ctrl } proc apply_config {} { From ea75ee3598ab6f8d0828f8cc6ec3d4a5f8d66813 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 27 May 2007 00:03:37 -0400 Subject: [PATCH 03/11] git-gui: Guess our share/git-gui/lib path at runtime if possible Johannes Sixt asked me to try to avoid embedding the runtime location of git-gui's library directory in the executable script. Not embedding it helps the MinGW to be relocatable to another directory should a user wish to install the programs in a directory other than the location the packager wanted them to be installed into. Most of this is a hack. We try to determine if the path of our master git-gui script will be able to locate the lib by ../share/git-gui/lib. This should be true if $(gitexecdir) and $(libdir) have the same prefix. If they do then we defer the assignment of $(libdir) until runtime, and we get it from $argv0 rather than embedding it into the script itself. Signed-off-by: Shawn O. Pearce --- Makefile | 12 ++++++++++-- git-gui.sh | 8 ++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ee564219c0..3de0de1a23 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ ifndef gitexecdir endif ifndef sharedir - sharedir := $(dir $(gitexecdir))/share + sharedir := $(dir $(gitexecdir))share endif ifndef INSTALL @@ -53,12 +53,19 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) libdir ?= $(sharedir)/git-gui/lib libdir_SQ = $(subst ','\'',$(libdir)) +exedir = $(dir $(gitexecdir))share/git-gui/lib +exedir_SQ = $(subst ','\'',$(exedir)) + $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh $(QUIET_GEN)rm -f $@ $@+ && \ + if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \ + GITGUI_RELATIVE=1; \ + fi && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \ -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ - -e 's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \ + -e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \ + -e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ @@ -88,6 +95,7 @@ TRACK_VARS = \ $(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \ $(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \ $(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \ + $(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \ $(subst ','\'',libdir='$(libdir_SQ)') \ #end TRACK_VARS diff --git a/git-gui.sh b/git-gui.sh index cfc4c7f686..dba585111c 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -25,7 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA} ## configure our library set oguilib {@@GITGUI_LIBDIR@@} -if {[string match @@GITGUI_*@@ $oguilib]} { +set oguirel {@@GITGUI_RELATIVE@@} +if {$oguirel eq {1}} { + set oguilib [file dirname [file dirname [file normalize $argv0]]] + set oguilib [file join $oguilib share git-gui lib] +} elseif {[string match @@* $oguirel]} { set oguilib [file join [file dirname [file normalize $argv0]] lib] } set idx [file join $oguilib tclIndex] @@ -55,7 +59,7 @@ if {$idx ne {}} { } else { set auto_path [concat [list $oguilib] $auto_path] } -unset -nocomplain fd idx +unset -nocomplain oguilib oguirel idx fd if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} { unset _verbose From eb09626b94fb21c67f47f71f8bada0d4aed306f5 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Tue, 29 May 2007 01:21:25 +0200 Subject: [PATCH 04/11] Fix stupid typo in lookup_tag() Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- tag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tag.c b/tag.c index 56a49f4fe1..e11a4cdc49 100644 --- a/tag.c +++ b/tag.c @@ -30,7 +30,7 @@ struct tag *lookup_tag(const unsigned char *sha1) if (!obj->type) obj->type = OBJ_TAG; if (obj->type != OBJ_TAG) { - error("Object %s is a %s, not a tree", + error("Object %s is a %s, not a tag", sha1_to_hex(sha1), typename(obj->type)); return NULL; } From 59d10247e444b752a993cf4aa2e0665bc633d32f Mon Sep 17 00:00:00 2001 From: Nguyen Thai Ngoc Duy Date: Mon, 28 May 2007 22:05:43 -0400 Subject: [PATCH 05/11] Makefile: Remove git-fsck and git-verify-pack from PROGRAMS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Those are builtins. Remove them from PROGRAMS variable Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 29243c6e8b..fb11fa1987 100644 --- a/Makefile +++ b/Makefile @@ -235,7 +235,7 @@ endif # ... and all the rest that could be moved out of bindir to gitexecdir PROGRAMS = \ - git-convert-objects$X git-fetch-pack$X git-fsck$X \ + git-convert-objects$X git-fetch-pack$X \ git-hash-object$X git-index-pack$X git-local-fetch$X \ git-fast-import$X \ git-merge-base$X \ @@ -246,7 +246,7 @@ PROGRAMS = \ git-show-index$X git-ssh-fetch$X \ git-ssh-upload$X git-unpack-file$X \ git-update-server-info$X \ - git-upload-pack$X git-verify-pack$X \ + git-upload-pack$X \ git-pack-redundant$X git-var$X \ git-merge-tree$X git-imap-send$X \ git-merge-recursive$X \ From 7faf068660f0a060066ccbc80f7debbba6bc2d76 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 May 2007 15:59:01 -0700 Subject: [PATCH 06/11] git-svn: avoid md5 calculation entirely if SVN doesn't provide one There's no point in calculating an MD5 if we're not going to use it. We'll also avoid the possibility of there being a bug in the Perl MD5 library not being able to handle zero-sized files. This is a followup to 20b3d206acbbb042c7ad5f42d36ff8d036a538c5, which allows us to track repositories that do not provide MD5 checksums. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index fa46236ae8..e35006142a 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -2472,12 +2472,16 @@ sub close_file { my $hash; my $path = $self->git_path($fb->{path}); if (my $fh = $fb->{fh}) { - seek($fh, 0, 0) or croak $!; - my $md5 = Digest::MD5->new; - $md5->addfile($fh); - my $got = $md5->hexdigest; - die "Checksum mismatch: $path\n", - "expected: $exp\n got: $got\n" if (defined $exp && $got ne $exp); + if (defined $exp) { + seek($fh, 0, 0) or croak $!; + my $md5 = Digest::MD5->new; + $md5->addfile($fh); + my $got = $md5->hexdigest; + if ($got ne $exp) { + die "Checksum mismatch: $path\n", + "expected: $exp\n got: $got\n"; + } + } sysseek($fh, 0, 0) or croak $!; if ($fb->{mode_b} == 120000) { sysread($fh, my $buf, 5) == 5 or croak $!; From dfab71cb923d031715ebc3cf9f920d801250c552 Mon Sep 17 00:00:00 2001 From: Andy Parkins Date: Sun, 27 May 2007 11:52:11 +0100 Subject: [PATCH 07/11] Add test case for $Id$ expanded in the repository This test case would have caught the bug fixed by revision c23290d5. It puts various forms of $Id$ into a file in the repository, without allowing git to collapse them to uniformity. Then enables the $Id$ expansion on checkout, and checks that what is checked out has coped with the various forms. Signed-off-by: Andy Parkins Signed-off-by: Junio C Hamano --- t/t0021-conversion.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 6c26fd829d..a839f4e074 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -45,4 +45,40 @@ test_expect_success check ' test "z$id" = "z$embedded" ' +# If an expanded ident ever gets into the repository, we want to make sure that +# it is collapsed before being expanded again on checkout +test_expect_success expanded_in_repo ' + { + echo "File with expanded keywords" + echo "\$Id\$" + echo "\$Id:\$" + echo "\$Id: 0000000000000000000000000000000000000000 \$" + echo "\$Id: NoSpaceAtEnd\$" + echo "\$Id:NoSpaceAtFront \$" + echo "\$Id:NoSpaceAtEitherEnd\$" + echo "\$Id: NoTerminatingSymbol" + } > expanded-keywords && + + { + echo "File with expanded keywords" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: 4f21723e7b15065df7de95bd46c8ba6fb1818f4c \$" + echo "\$Id: NoTerminatingSymbol" + } > expected-output && + + git add expanded-keywords && + git commit -m "File with keywords expanded" && + + echo "expanded-keywords ident" >> .gitattributes && + + rm -f expanded-keywords && + git checkout -- expanded-keywords && + cat expanded-keywords && + cmp expanded-keywords expected-output +' + test_done From c78974f7b6a6a0e9f848907620b4361ee088f7c2 Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Sat, 26 May 2007 21:16:27 +0200 Subject: [PATCH 08/11] user-manual: fixed typo in example Signed-off-by: Steffen Prohaska Signed-off-by: Junio C Hamano --- Documentation/user-manual.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 52247aa713..4fabb8e2a9 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -872,7 +872,7 @@ Obviously, endless variations are possible; for example, to see all commits reachable from some head but not from any tag in the repository: ------------------------------------------------- -$ gitk ($ git show-ref --heads ) --not $( git show-ref --tags ) +$ gitk $( git show-ref --heads ) --not $( git show-ref --tags ) ------------------------------------------------- (See gitlink:git-rev-parse[1] for explanations of commit-selecting From 893c365abab7806354ab5b268e38e88ea81b8e38 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 27 May 2007 14:33:06 +0200 Subject: [PATCH 09/11] cvsserver: Correct inetd.conf example in asciidoc documentation While the given example worked, it made us look rather incompetent. Give the correct reason why one needs the more complex syntax and change the example to reflect that. Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- Documentation/git-cvsserver.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index d22844ba49..9f0d990804 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -46,11 +46,13 @@ INSTALLATION cvspserver stream tcp nowait nobody git-cvsserver pserver ------ -Note: In some cases, you need to pass the 'pserver' argument twice for -git-cvsserver to see it. So the line would look like +Note: Some inetd servers let you specify the name of the executable +independently of the value of argv[0] (i.e. the name the program assumes +it was executed with). In this case the correct line in /etc/inetd.conf +looks like ------ - cvspserver stream tcp nowait nobody git-cvsserver pserver pserver + cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver ------ No special setup is needed for SSH access, other than having GIT tools From 548428954aa088aecd88805aa5a8e64aee0d3e8b Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 27 May 2007 14:33:07 +0200 Subject: [PATCH 10/11] cvsserver: Note that CVS_SERVER can also be specified as method variable Reasonably new versions of the cvs CLI client allow one to specifiy CVS_SERVER as a method variable directly in CVSROOT. This is way more convinient than using an environment variable since it gets saved in CVS/Root. Since I only discovered this by accident I guess there might be others out there that learnt CVS on the 1.11 series (or even earlier) and profit from such a note about cvs improvements in the last couple years. Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- Documentation/git-cvsserver.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index 9f0d990804..ca7579d9f5 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -57,7 +57,17 @@ looks like ------ No special setup is needed for SSH access, other than having GIT tools in the PATH. If you have clients that do not accept the CVS_SERVER -env variable, you can rename git-cvsserver to cvs. +environment variable, you can rename git-cvsserver to cvs. + +Note: Newer cvs versions (>= 1.12.11) also support specifying +CVS_SERVER directly in CVSROOT like + +------ +cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co +------ +This has the advantage that it will be saved in your 'CVS/Root' files and +you don't need to worry about always setting the correct environment +variable. -- 2. For each repo that you want accessible from CVS you need to edit config in the repo and add the following section. From a192a909c0cdb8ea09b6513c4839fd6762989cb1 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Sun, 27 May 2007 14:33:08 +0200 Subject: [PATCH 11/11] cvsserver: Fix some typos in asciidoc documentation Signed-off-by: Frank Lichtenheld Signed-off-by: Junio C Hamano --- Documentation/git-cvsserver.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index ca7579d9f5..e5005f02f9 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -86,7 +86,7 @@ write access to the log file and to the database (see SSH, the users of course also need write access to the git repository itself. [[configaccessmethod]] -All configuration variables can also be overriden for a specific method of +All configuration variables can also be overridden for a specific method of access. Valid method names are "ext" (for SSH access) and "pserver". The following example configuration would disable pserver access while still allowing access over SSH. @@ -128,7 +128,7 @@ Database Backend git-cvsserver uses one database per git head (i.e. CVS module) to store information about the repository for faster access. The -database doesn't contain any persitent data and can be completly +database doesn't contain any persistent data and can be completely regenerated from the git repository at any time. The database needs to be updated (i.e. written to) after every commit.