From 3abe217a5bd1aefa748d53c08704b2a8a622307c Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 28 Feb 2006 19:11:08 +0530 Subject: [PATCH 01/11] gitview: Select the text color based on whether the entry in highlighted. Use standard font. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Junio C Hamano --- contrib/gitview/gitview | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index 048caf6f86..aded7ede70 100755 --- a/contrib/gitview/gitview +++ b/contrib/gitview/gitview @@ -239,20 +239,23 @@ class CellRendererGraph(gtk.GenericCellRenderer): box_size / 4, 0, 2 * math.pi) + self.set_colour(ctx, colour, 0.0, 0.5) + ctx.stroke_preserve() + + self.set_colour(ctx, colour, 0.5, 1.0) + ctx.fill_preserve() + if (len(names) != 0): name = " " for item in names: name = name + item + " " - ctx.select_font_face("Monospace") ctx.set_font_size(13) - ctx.text_path(name) - - self.set_colour(ctx, colour, 0.0, 0.5) - ctx.stroke_preserve() - - self.set_colour(ctx, colour, 0.5, 1.0) - ctx.fill() + if (flags & 1): + self.set_colour(ctx, colour, 0.5, 1.0) + else: + self.set_colour(ctx, colour, 0.0, 0.5) + ctx.show_text(name) class Commit: """ This represent a commit object obtained after parsing the git-rev-list From 0852694ba432aafff5d7619e3acc30f30f2339b7 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Tue, 28 Feb 2006 19:12:18 +0530 Subject: [PATCH 02/11] gitview: Some window layout changes. This makes menubar look nice Signed-off-by: Aneesh Kumar K.V Signed-off-by: Junio C Hamano --- contrib/gitview/gitview | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index aded7ede70..47ecaa3566 100755 --- a/contrib/gitview/gitview +++ b/contrib/gitview/gitview @@ -368,7 +368,7 @@ class DiffWindow: save_menu.connect("activate", self.save_menu_response, "save") save_menu.show() menu_bar.append(save_menu) - vbox.pack_start(menu_bar, False, False, 2) + vbox.pack_start(menu_bar, expand=False, fill=True) menu_bar.show() scrollwin = gtk.ScrolledWindow() @@ -482,19 +482,10 @@ class GitView: def construct(self): """Construct the window contents.""" + vbox = gtk.VBox() paned = gtk.VPaned() paned.pack1(self.construct_top(), resize=False, shrink=True) paned.pack2(self.construct_bottom(), resize=False, shrink=True) - self.window.add(paned) - paned.show() - - - def construct_top(self): - """Construct the top-half of the window.""" - vbox = gtk.VBox(spacing=6) - vbox.set_border_width(12) - vbox.show() - menu_bar = gtk.MenuBar() menu_bar.set_pack_direction(gtk.PACK_DIRECTION_RTL) help_menu = gtk.MenuItem("Help") @@ -506,8 +497,20 @@ class GitView: help_menu.set_submenu(menu) help_menu.show() menu_bar.append(help_menu) - vbox.pack_start(menu_bar, False, False, 2) menu_bar.show() + vbox.pack_start(menu_bar, expand=False, fill=True) + vbox.pack_start(paned, expand=True, fill=True) + self.window.add(vbox) + paned.show() + vbox.show() + + + def construct_top(self): + """Construct the top-half of the window.""" + vbox = gtk.VBox(spacing=6) + vbox.set_border_width(12) + vbox.show() + scrollwin = gtk.ScrolledWindow() scrollwin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) From d82343b93860348215db0c7267bc051e5f80aefa Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Tue, 28 Feb 2006 20:10:28 +0530 Subject: [PATCH 03/11] gitview: Set the default width of graph cell Signed-off-by: Aneesh Kumar K.V Signed-off-by: Junio C Hamano --- contrib/gitview/gitview | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/gitview/gitview b/contrib/gitview/gitview index 47ecaa3566..ea05cd4240 100755 --- a/contrib/gitview/gitview +++ b/contrib/gitview/gitview @@ -526,6 +526,9 @@ class GitView: self.treeview.show() cell = CellRendererGraph() + # Set the default width to 265 + # This make sure that we have nice display with large tag names + cell.set_property("width", 265) column = gtk.TreeViewColumn() column.set_resizable(True) column.pack_start(cell, expand=True) From e3601e8bb76e46745d4919c3f30b1dddae040eb2 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Tue, 28 Feb 2006 09:03:48 -0500 Subject: [PATCH 04/11] Darwin: Ignore missing /sw/lib When on Darwin platforms don't include Fink or DarwinPorts into the link path unless the related library directory is actually present. The linker on MacOS 10.4 complains if it is given a directory which does not exist. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6c59cee414..19578fc93a 100644 --- a/Makefile +++ b/Makefile @@ -223,11 +223,15 @@ ifeq ($(uname_S),Darwin) NEEDS_SSL_WITH_CRYPTO = YesPlease NEEDS_LIBICONV = YesPlease ## fink - ALL_CFLAGS += -I/sw/include - ALL_LDFLAGS += -L/sw/lib + ifeq ($(shell test -d /sw/lib && echo y),y) + ALL_CFLAGS += -I/sw/include + ALL_LDFLAGS += -L/sw/lib + endif ## darwinports - ALL_CFLAGS += -I/opt/local/include - ALL_LDFLAGS += -L/opt/local/lib + ifeq ($(shell test -d /opt/local/lib && echo y),y) + ALL_CFLAGS += -I/opt/local/include + ALL_LDFLAGS += -L/opt/local/lib + endif endif ifeq ($(uname_S),SunOS) NEEDS_SOCKET = YesPlease From aeecd23ae2785a0462d42191974e9d9a8e439fbe Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 28 Feb 2006 20:19:47 -0800 Subject: [PATCH 05/11] diffcore-break: micro-optimize by avoiding delta between identical files. We did not check if we have the same file on both sides when computing break score. This is usually not a problem, but if the user said --find-copies-harde with -B, we ended up trying a delta between the same data even when we know the SHA1 hash of both sides match. Signed-off-by: Junio C Hamano --- diffcore-break.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/diffcore-break.c b/diffcore-break.c index c57513a4fa..95b5eb492e 100644 --- a/diffcore-break.c +++ b/diffcore-break.c @@ -58,6 +58,10 @@ static int should_break(struct diff_filespec *src, if (!S_ISREG(src->mode) || !S_ISREG(dst->mode)) return 0; /* leave symlink rename alone */ + if (src->sha1_valid && dst->sha1_valid && + !memcmp(src->sha1, dst->sha1, 20)) + return 0; /* they are the same */ + if (diff_populate_filespec(src, 0) || diff_populate_filespec(dst, 0)) return 0; /* error but caught downstream */ From 49cc27bb46dc5dddc59c9802c1eed1ee6126537e Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Fri, 24 Feb 2006 12:20:51 +1300 Subject: [PATCH 06/11] cvsserver: add notes on how to get a checkout under Eclipse --- Documentation/git-cvsserver.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index 88f07ff15d..fcc49b29c9 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -54,6 +54,30 @@ INSTALLATION of branches in git). $ cvs co -d mylocaldir master +Eclipse CVS Client Notes +------------------------ + +To get a checkout with the Eclipse CVS client: + +1. Create a new project from CVS checkout, giving it repository and module +2. Context Menu->Team->Share Project... +3. Enter the repository and module information again and click Finish +4. The Synchronize view appears. Untick "launch commit wizard" to avoid +committing the .project file, and select HEAD as the tag to synchronize to. +Update all incoming changes. + +Note that most versions of Eclipse ignore CVS_SERVER (which you can set in +the Preferences->Team->CVS->ExtConnection pane), so you may have to +rename, alias or symlink git-cvsserver to 'cvs' on the server. + +Clients known to work +--------------------- + +CVS 1.12.9 on Debian +CVS 1.11.17 on MacOSX (from Fink package) +Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes) +TortoiseCVS + Operations supported -------------------- From 5793aa1cc08df7c4021509556637ade2d639083f Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Wed, 1 Mar 2006 19:30:35 +1300 Subject: [PATCH 07/11] cvsserver: Eclipse compat fixes - implement Questionable, alias rlog, add a space after the U A few things to satisfy Eclipse's strange habits as a cvs client: - Implement Questionable - Aliased rlog to log, but more work may be needed - Add a space after the U that indicates updated --- git-cvsserver.perl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index d20d1a8c4b..33fcc1156b 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -53,6 +53,7 @@ my $methods = { 'Entry' => \&req_Entry, 'Modified' => \&req_Modified, 'Unchanged' => \&req_Unchanged, + 'Questionable' => \&req_Questionable, 'Argument' => \&req_Argument, 'Argumentx' => \&req_Argument, 'expand-modules' => \&req_expandmodules, @@ -63,6 +64,7 @@ my $methods = { 'ci' => \&req_ci, 'diff' => \&req_diff, 'log' => \&req_log, + 'rlog' => \&req_log, 'tag' => \&req_CATCHALL, 'status' => \&req_status, 'admin' => \&req_CATCHALL, @@ -459,6 +461,22 @@ sub req_Unchanged #$log->debug("req_Unchanged : $data"); } +# Questionable filename \n +# Response expected: no. Additional data: no. +# Tell the server to check whether filename should be ignored, +# and if not, next time the server sends responses, send (in +# a M response) `?' followed by the directory and filename. +# filename must not contain `/'; it needs to be a file in the +# directory named by the most recent Directory request. +sub req_Questionable +{ + my ( $cmd, $data ) = @_; + + $state->{entries}{$state->{directory}.$data}{questionable} = 1; + + #$log->debug("req_Questionable : $data"); +} + # Argument text \n # Response expected: no. Save argument for use in a subsequent command. # Arguments accumulate until an argument-using command is given, at which @@ -568,7 +586,7 @@ sub req_co # print some information to the client print "MT +updated\n"; - print "MT text U\n"; + print "MT text U \n"; if ( defined ( $git->{dir} ) and $git->{dir} ne "./" ) { print "MT fname $checkout_path/$git->{dir}$git->{name}\n"; @@ -579,9 +597,9 @@ sub req_co print "MT -updated\n"; # instruct client we're sending a file to put in this path - print "Created $checkout_path/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "\n"; + print "Created $checkout_path/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "\n"; - print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "$git->{name}\n"; + print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "$git->{name}\n"; # this is an "entries" line print "/$git->{name}/1.$git->{revision}///\n"; From f0bcd511ee3a00b7fd3975a386aa1165c07a0721 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Wed, 1 Mar 2006 20:03:58 +1300 Subject: [PATCH 08/11] cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works Eclipse CVS clients have an odd way of perusing the top level of the repository, by calling update on module "". So reproduce cvs' odd behaviour in the interest of compatibility. It makes it much easier to get a checkout when using Eclipse. --- git-cvsserver.perl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 33fcc1156b..20a9baeb71 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -630,6 +630,26 @@ sub req_update argsplit("update"); + # + # It may just be a client exploring the available heads/modukles + # in that case, list them as top level directories and leave it + # at that. Eclipse uses this technique to offer you a list of + # projects (heads in this case) to checkout. + # + if ($state->{module} eq '') { + print "E cvs update: Updating .\n"; + opendir HEADS, $state->{CVSROOT} . '/refs/heads'; + while (my $head = readdir(HEADS)) { + if (-f $state->{CVSROOT} . '/refs/heads/' . $head) { + print "E cvs update: New directory `$head'\n"; + } + } + closedir HEADS; + print "ok\n"; + return 1; + } + + # Grab a handle to the SQLite db and do any necessary updates my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); From ee75d4cd310a2d45b641f4524565bea6fd1d1ecc Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Fri, 24 Feb 2006 12:20:51 +1300 Subject: [PATCH 09/11] cvsserver: add notes on how to get a checkout under Eclipse --- Documentation/git-cvsserver.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index 88f07ff15d..19c9c51cff 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -54,6 +54,30 @@ INSTALLATION of branches in git). $ cvs co -d mylocaldir master +Eclipse CVS Client Notes +------------------------ + +To get a checkout with the Eclipse CVS client: + +1. Create a new project from CVS checkout, giving it repository and module +2. Context Menu->Team->Share Project... +3. Enter the repository and module information again and click Finish +4. The Synchronize view appears. Untick "launch commit wizard" to avoid +committing the .project file, and select HEAD as the tag to synchronize to. +Update all incoming changes. + +Note that most versions of Eclipse ignore CVS_SERVER (which you can set in +the Preferences->Team->CVS->ExtConnection pane), so you may have to +rename, alias or symlink git-cvsserver to 'cvs' on the server. + +Clients known to work +--------------------- + +CVS 1.12.9 on Debian +CVS 1.11.17 on MacOSX (from Fink package) +Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes) +TortoiseCVS + Operations supported -------------------- From 7172aabb4b5a6d0345b3c57f2f7ededece81b9b7 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Wed, 1 Mar 2006 19:30:35 +1300 Subject: [PATCH 10/11] cvsserver: Eclipse compat fixes - implement Questionable, alias rlog, add a space after the U A few things to satisfy Eclipse's strange habits as a cvs client: - Implement Questionable - Aliased rlog to log, but more work may be needed - Add a space after the U that indicates updated --- git-cvsserver.perl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index d20d1a8c4b..344b2f398b 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -53,6 +53,7 @@ my $methods = { 'Entry' => \&req_Entry, 'Modified' => \&req_Modified, 'Unchanged' => \&req_Unchanged, + 'Questionable' => \&req_Questionable, 'Argument' => \&req_Argument, 'Argumentx' => \&req_Argument, 'expand-modules' => \&req_expandmodules, @@ -63,6 +64,7 @@ my $methods = { 'ci' => \&req_ci, 'diff' => \&req_diff, 'log' => \&req_log, + 'rlog' => \&req_log, 'tag' => \&req_CATCHALL, 'status' => \&req_status, 'admin' => \&req_CATCHALL, @@ -459,6 +461,22 @@ sub req_Unchanged #$log->debug("req_Unchanged : $data"); } +# Questionable filename \n +# Response expected: no. Additional data: no. +# Tell the server to check whether filename should be ignored, +# and if not, next time the server sends responses, send (in +# a M response) `?' followed by the directory and filename. +# filename must not contain `/'; it needs to be a file in the +# directory named by the most recent Directory request. +sub req_Questionable +{ + my ( $cmd, $data ) = @_; + + $state->{entries}{$state->{directory}.$data}{questionable} = 1; + + #$log->debug("req_Questionable : $data"); +} + # Argument text \n # Response expected: no. Save argument for use in a subsequent command. # Arguments accumulate until an argument-using command is given, at which @@ -568,7 +586,7 @@ sub req_co # print some information to the client print "MT +updated\n"; - print "MT text U\n"; + print "MT text U \n"; if ( defined ( $git->{dir} ) and $git->{dir} ne "./" ) { print "MT fname $checkout_path/$git->{dir}$git->{name}\n"; @@ -579,9 +597,9 @@ sub req_co print "MT -updated\n"; # instruct client we're sending a file to put in this path - print "Created $checkout_path/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "\n"; + print "Created $checkout_path/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "\n"; - print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) ? $git->{dir} . "/" : "" ) . "$git->{name}\n"; + print $state->{CVSROOT} . "/$module/" . ( defined ( $git->{dir} ) and $git->{dir} ne "./" ? $git->{dir} . "/" : "" ) . "$git->{name}\n"; # this is an "entries" line print "/$git->{name}/1.$git->{revision}///\n"; From 858cbfbabe4ede5f5eba32041eb7448319e53e2a Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Wed, 1 Mar 2006 20:03:58 +1300 Subject: [PATCH 11/11] cvsserver: Eclipse compat - browsing 'modules' (heads in our case) works Eclipse CVS clients have an odd way of perusing the top level of the repository, by calling update on module "". So reproduce cvs' odd behaviour in the interest of compatibility. It makes it much easier to get a checkout when using Eclipse. --- git-cvsserver.perl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 344b2f398b..3c588c9d64 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -630,6 +630,26 @@ sub req_update argsplit("update"); + # + # It may just be a client exploring the available heads/modukles + # in that case, list them as top level directories and leave it + # at that. Eclipse uses this technique to offer you a list of + # projects (heads in this case) to checkout. + # + if ($state->{module} eq '') { + print "E cvs update: Updating .\n"; + opendir HEADS, $state->{CVSROOT} . '/refs/heads'; + while (my $head = readdir(HEADS)) { + if (-f $state->{CVSROOT} . '/refs/heads/' . $head) { + print "E cvs update: New directory `$head'\n"; + } + } + closedir HEADS; + print "ok\n"; + return 1; + } + + # Grab a handle to the SQLite db and do any necessary updates my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log);