Git development
 help / color / mirror / Atom feed
* Files with colons under Cygwin
From: Giovanni Funchal @ 2008-10-02 14:02 UTC (permalink / raw)
  To: git

Hello,

Cygwin does not allow files with colons, I think this is Windows stuff
one just can't avoid. If you have files with colons in a git
repository and try pulling them on cygwin, the file is empty, its name
is truncated and the status is wrong.

linux $ date > a:b
linux $ git init
linux $ git add a:b
linux $ git commit -m test
linux $ git push
cygwin $ git pull
cygwin $ ls
-rw-r--r-- 1 funchal funchal        0 Oct  2 15:15 a
cygwin $ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       a
nothing added to commit but untracked files present (use "git add" to track)

Any ideas on what should be done? (for instance, warn when pulling
this kind of files on Cygwin)

Has anyone noticed this before?

Regards,
-- Giovanni

^ permalink raw reply

* Re: How to remove a commit object?
From: Jakub Narebski @ 2008-10-02 14:02 UTC (permalink / raw)
  To: Klas Lindberg; +Cc: Michael J Gruber, Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020636g77f4180cm7aa6b7de07ae5beb@mail.gmail.com>

"Klas Lindberg" <klas.lindberg@gmail.com> writes:

> This doesn't seem to work for me. I will soon be in a situation where
> I need to selectively delete commits in such a way that they become
> completely irrecoverable. I.e. it is not enough to revert a commit.
> The *original* commit must be removed. And of course, the repo history
> is too complex to allow for rebasing followed by garbage collection or
> something like that.
[...]

> Would it be feasible to write a tool that can selectively replace a
> specific commit in the commit DAG, or would that automatically
> invalidate every SHA key for every commit that follows the replaced
> original?

It would invalidate SHA1 for every commit after first rewritten.
There are two tools which you can use to rewrite large parts of
history automatically: git-filter-branch, and git-fast-export +
git-fast-import.

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply

* Re: [PATCH] format-patch: autonumber by default
From: Jakub Narebski @ 2008-10-02 14:08 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: git, Johannes Schindelin, Shawn O. Pearce
In-Reply-To: <1222955278-16908-1-git-send-email-giuseppe.bilotta@gmail.com>

Giuseppe Bilotta wrote:
> format-patch is most commoly used for multiple patches at once when

s/commoly/commonly/;

I'm not sure about 'most' there...

> sending a patchset, in which case we want to number the patches; on the
> other hand, single-patches are not usually expected to be numbered.
> 
> The typical behavior expected by format-patch is therefore the one
> obtained by enabling autonumber, which should therefore be the default.
> 
> Users that want to disable numbering for a particular patchset can do so
> with the existing -N command-line switch. For users that want to change
> the default behavior we provide a 'noauto' option for the
> format.numbering config key.

Nice. I like it.
-- 
Jakub Narebski
Poland

^ permalink raw reply

* Re: [PATCH] format-patch: autonumber by default
From: Andreas Ericsson @ 2008-10-02 14:14 UTC (permalink / raw)
  To: Jakub Narebski
  Cc: Giuseppe Bilotta, git, Johannes Schindelin, Shawn O. Pearce
In-Reply-To: <200810021608.54287.jnareb@gmail.com>

Jakub Narebski wrote:
> Giuseppe Bilotta wrote:
>> format-patch is most commoly used for multiple patches at once when
> 
> s/commoly/commonly/;
> 
> I'm not sure about 'most' there...

In that case, just make it "often" and cut "most commoly" (sic) out.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply

* Re: update-index --unresolve
From: SZEDER Gábor @ 2008-10-02 14:18 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <m3tzbvqesz.fsf@localhost.localdomain>

Hi Jakub,

On Thu, Oct 02, 2008 at 06:58:41AM -0700, Jakub Narebski wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes:
> >   --unresolve::
> >          Restores the 'unmerged' or 'needs updating' state of a
> >          file during a merge if it was cleared by accident.
> > 
> > How could I clear those states by accident (or intentionally)?
> 
> "git add <file>", or "git update-index <file>", or error in handling
> merge tool via git-mergetool.
Thanks for your fast reply.

However:

# ...  do a conflicting merge
(master|MERGING)$ echo 4 >one
(master|MERGING)$ git status
one: needs merge
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
#   directory)
#
#       unmerged:   one
#
no changes added to commit (use "git add" and/or "git commit -a")
(master|MERGING)$ git add one
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   one
#
(master|MERGING)$ git update-index --unresolve
(master|MERGING)$ echo $?
0
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   one
#

So, as you can see, after 'add ; update-index --unresolve' the file is
not marked as unmerged, but it's still ready to be committed.

Is something wrong going on here, or it is indeed the intended
behaviour and I misunderstood this functionality?

Thanks,
Gábor

^ permalink raw reply

* Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
From: Petr Baudis @ 2008-10-02 14:22 UTC (permalink / raw)
  To: Giuseppe Bilotta; +Cc: git, Jakub Narebski, Junio C Hamano, Shawn O. Pearce
In-Reply-To: <1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com>

On Mon, Sep 29, 2008 at 03:07:42PM +0200, Giuseppe Bilotta wrote:
> This patch fixes PATH_INFO handling by removing the relevant part from
> $my_url and $my_uri, thus making it unnecessary to specify them by hand
> in the gitweb configuration.
> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Acked-by: Petr Baudis <pasky@suse.cz>

^ permalink raw reply

* [PATCH] gitweb: Identify all summary metadata table rows
From: Petr Baudis @ 2008-10-02 14:25 UTC (permalink / raw)
  To: git, git; +Cc: Petr Baudis

In the metadata table of the summary page, all rows have their
id (or class in case of URL) set now. This for example lets sites
easily disable fields they do not want to show in their custom
stylesheet (e.g. they are overly technical or irrelevant for the site).

Many of my other patches depend on this, so I would appreciate to hear
as soon as possible if someone has an issue with this patch.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>

---
 gitweb/gitweb.perl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..bd8124a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4070,10 +4070,10 @@ sub git_summary {
 
 	print "<div class=\"title\">&nbsp;</div>\n";
 	print "<table class=\"projects_list\">\n" .
-	      "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
-	      "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
+	      "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
+	      "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
 	if (defined $cd{'rfc2822'}) {
-		print "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+		print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
 	}
 
 	# use per project git URL list in $projectroot/$project/cloneurl
@@ -4083,7 +4083,7 @@ sub git_summary {
 	@url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
 	foreach my $git_url (@url_list) {
 		next unless $git_url;
-		print "<tr><td>$url_tag</td><td>$git_url</td></tr>\n";
+		print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
 		$url_tag = "";
 	}
 	print "</table>\n";
-- 
tg: (c427559..) t/summary/css-metadata (depends on: vanilla/master)

^ permalink raw reply related

* Re: update-index --unresolve
From: SZEDER Gábor @ 2008-10-02 14:25 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <20081002141853.GD6839@neumann>

On Thu, Oct 02, 2008 at 04:18:53PM +0200, SZEDER Gábor wrote:
> > > How could I clear those states by accident (or intentionally)?
> > 
> > "git add <file>", or "git update-index <file>", or error in handling
> > merge tool via git-mergetool.
> Thanks for your fast reply.
> 
> However:
> 
> # ...  do a conflicting merge
> (master|MERGING)$ echo 4 >one
> (master|MERGING)$ git status
> one: needs merge
> # On branch master
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working
> #   directory)
> #
> #       unmerged:   one
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> (master|MERGING)$ git add one
> (master|MERGING)$ git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #       modified:   one
> #
> (master|MERGING)$ git update-index --unresolve

Ah, that should be 'git update-index --unresolve one', and
everything works as expected.


Sorry,
Gábor

^ permalink raw reply

* Re: How to remove a commit object?
From: Klas Lindberg @ 2008-10-02 14:26 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Michael J Gruber, Steven Grimm, Git Users List
In-Reply-To: <m3ljx7qemk.fsf@localhost.localdomain>

Repo size is a problem too, actually.

A solution to both problems seemed to be to use git-filter-branch to
create a new repo by filtering out all the unwanted files. The
astonishing result was that, for the subdirectory I tried it on, 90%
or so of the commits on that subdirectory just disappeared. It didn't
look right at all. Although I can't say for sure exactly what I did
with filter-branch, I would appreciate some guidance for using it. It
basically seemed to do exactly what I wanted (recreate the repo, minus
some explicit stuff, with history intact otherwise), except the result
looked crazy.

/Klas

On Thu, Oct 2, 2008 at 4:02 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> "Klas Lindberg" <klas.lindberg@gmail.com> writes:
>
>> This doesn't seem to work for me. I will soon be in a situation where
>> I need to selectively delete commits in such a way that they become
>> completely irrecoverable. I.e. it is not enough to revert a commit.
>> The *original* commit must be removed. And of course, the repo history
>> is too complex to allow for rebasing followed by garbage collection or
>> something like that.
> [...]
>
>> Would it be feasible to write a tool that can selectively replace a
>> specific commit in the commit DAG, or would that automatically
>> invalidate every SHA key for every commit that follows the replaced
>> original?
>
> It would invalidate SHA1 for every commit after first rewritten.
> There are two tools which you can use to rewrite large parts of
> history automatically: git-filter-branch, and git-fast-export +
> git-fast-import.
>
> HTH
> --
> Jakub Narebski
> Poland
> ShadeHawk on #git
>

^ permalink raw reply

* Re: corrupted repository?
From: Shawn O. Pearce @ 2008-10-02 14:29 UTC (permalink / raw)
  To: Francois Pepin; +Cc: git
In-Reply-To: <48E3EBC2.7090107@cs.mcgill.ca>

Francois Pepin <fpepin@cs.mcgill.ca> wrote:
> Everything seems to be working properly there (git fsck --full returns  
> normally with no output), but I cannot clone or pull from my other 
> machines:
...
> [francois@Iduna ~]$ git clone localhost:git git2
> Initialized empty Git repository in /Users/francois/git2/.git/
> remote: fatal: exec pack-objects failed.

Your git-upload-pack cannot find git-pack-objects.  It sounds like
Git was incorrectly installed on your system.

  which git-upload-pack ?
  which git ?
  are they in the same directory?
  did you possibly move git after installing it?

  git --exec-path?
  does that exist?
  does it have git-pack-objects inside it?

> I am running git 1.6.0.2 on the mac, and have only recently updated it  
> so that might have a role to play.

I think it is the upgrade.  It sounds like its not installed correcly
because the helpers in libexec/git-core cannot be found.

-- 
Shawn.

^ permalink raw reply

* Re: How to remove a commit object?
From: Michael J Gruber @ 2008-10-02 14:30 UTC (permalink / raw)
  To: Klas Lindberg; +Cc: Jakub Narebski, Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020726g71c6f39eq16585269fb268322@mail.gmail.com>

Klas Lindberg venit, vidit, dixit 02.10.2008 16:26:
> Repo size is a problem too, actually.
> 
> A solution to both problems seemed to be to use git-filter-branch to
> create a new repo by filtering out all the unwanted files. The
> astonishing result was that, for the subdirectory I tried it on, 90%
> or so of the commits on that subdirectory just disappeared. It didn't
> look right at all. Although I can't say for sure exactly what I did
> with filter-branch, I would appreciate some guidance for using it. It

I don't know about others, but I would appreciate more info:
Do you want to remove commits (as stated earlier) or files (as stated here)?
What are the boundary conditions? Rewriting history seems to be OK now.

> basically seemed to do exactly what I wanted (recreate the repo, minus
> some explicit stuff, with history intact otherwise), except the result
> looked crazy.

That may be due to the filter-branch incarnation, i.e. which refs did
you rewrite (--all or HEAD)?

Michael

^ permalink raw reply

* [PATCH] gitweb: Add support for extending the action bar with custom links
From: Petr Baudis @ 2008-10-02 14:36 UTC (permalink / raw)
  To: git, git

This makes it possible to easily extend gitweb with custom functionality,
e.g. git-browser or web-based repository administration system like
the repo.or.cz/Girocco duct tape.

Signed-off-by: Petr Baudis <pasky@suse.cz>

---
 gitweb/gitweb.perl |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..9fbc9f8 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -275,6 +275,26 @@ our %feature = (
 	'forks' => {
 		'override' => 0,
 		'default' => [0]},
+
+	# Insert custom links to the action bar of all project pages.
+	# This enables you mainly to link to third-party scripts integrating
+	# into gitweb; e.g. git-browser for graphical history representation
+	# or custom web-based repository administration interface.
+
+	# The 'default' value consists of a list of triplets in the form
+	# (label, link, position) where position is the label after which
+	# to inster the link and link is a format string where %n expands
+	# to the project name, %f to the project path within the filesystem,
+	# %h to the current hash (h gitweb parameter) and %b to the current
+	# hash base (hb gitweb parameter).
+
+	# To enable system wide have in $GITWEB_CONFIG e.g.
+	# $feature{'actions'}{'default'} = [('graphiclog',
+	# 	'/git-browser/by-commit.html?r=%n', 'summary')];
+	# Project specific override is not supported.
+	'actions' => {
+		'override' => 0,
+		'default' => []},
 );
 
 sub gitweb_check_feature {
@@ -2757,13 +2777,26 @@ sub git_print_page_nav {
 			}
 		}
 	}
+
 	$arg{'tree'}{'hash'} = $treehead if defined $treehead;
 	$arg{'tree'}{'hash_base'} = $treebase if defined $treebase;
 
+	my @actions = gitweb_check_feature('actions');
+	while (@actions) {
+		my ($label, $link, $pos) = (shift(@actions), shift(@actions), shift(@actions));
+		@navs = map { $_ eq $pos ? ($_, $label) : $_ } @navs;
+		# munch munch
+		$link =~ s#%n#$project#g;
+		$link =~ s#%f#$git_dir#g;
+		$treehead ? $link =~ s#%h#$treehead#g : $link =~ s#%h##g;
+		$treebase ? $link =~ s#%b#$treebase#g : $link =~ s#%b##g;
+		$arg{$label}{'_href'} = $link;
+	}
+
 	print "<div class=\"page_nav\">\n" .
 		(join " | ",
 		 map { $_ eq $current ?
-		       $_ : $cgi->a({-href => href(%{$arg{$_}})}, "$_")
+		       $_ : $cgi->a({-href => ($arg{$_}{_href} ? $arg{$_}{_href} : href(%{$arg{$_}}))}, "$_")
 		 } @navs);
 	print "<br/>\n$extra<br/>\n" .
 	      "</div>\n";
-- 
tg: (c427559..) t/extra-actions/extra-actions (depends on: vanilla/master)

^ permalink raw reply related

* Re: git svn bug?
From: Björn Steinbrink @ 2008-10-02 14:49 UTC (permalink / raw)
  To: Ark Xu; +Cc: git
In-Reply-To: <36C9BCCC-875A-4C65-98E2-0AD486FF8F61@gmail.com>

On 2008.10.02 16:50:45 +0800, Ark Xu wrote:
> Hi guys,
>
>   I like git very much so I also use git svn for subversion repo.
>
>   Now I got a tough problem which stopping me for any svn related  
> operations. There is a file log4j.xml that is somehow strange because  
> when I fetch it, i got the following message:
>
> tms-service/src/test/resources/log4j.xml has mode 120000 but is not a  
> link at /opt/local/bin/git-svn line 3230.
> M	tms-service/src/test/resources/log4j.xml
>
>   And then, all the operation will lead to :
> Checksum mismatch: branches/5.3/tms-service/src/test/resources/log4j.xml 
> 51031cbb0e1a2e878e4a3836cf0baa9b80a037a5
> expected: fab6daef9fc355b9342e26047f5d0141
>      got: 0e7e9081d608c80d2de0340ba5cd1600
>
> Could anybody help?

Which git version? And is your /tmp large enough to store that file?

Björn

^ permalink raw reply

* Re: Help with a tcl/tk gui thing..
From: Linus Torvalds @ 2008-10-02 14:49 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Git Mailing List
In-Reply-To: <237967ef0810012218i28d41573s6bb7866e0be485f2@mail.gmail.com>



On Thu, 2 Oct 2008, Mikael Magnusson wrote:
> 
> Heh, sorry, I'm an idiot. I forgot to put '#!/usr/bin/python' on the first
> line. I was running 'python tracker-ui.py' then did chmod +x just before
> committing :). So the cross is coming from running 'import time'.

Ahh. It did _something_, so I assumed it was working, just not well. Being 
confused about the language would do it ;)

I fixed it up and merged it as an alternate UI. It doesn't react well to a 
tracker file that has just been initialized with the timeout (but without 
any of the extra information that gets filled out once you actually start 
getting tracked), but it's certainly prettier than my original one.

Thanks,

		Linus

^ permalink raw reply

* [PATCH (BUGFIX)] gitweb: Fix two 'uninitialized value' varnings in git_tree()
From: Jakub Narebski @ 2008-10-02 14:50 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

If we did try to access nonexistent directory or file, which means
that git_get_hash_by_path() returns `undef`, uninitialized $hash
variable was passed to 'open' call.  Now we fail early with "404 Not
Found - No such tree" error.  (If we try to access something which
does not resolve to tree-ish, for example a file / 'blob' object, the
error will be caught later, as "404 Not Found - Reading tree failed"
error).

If we tried to use 'tree' action without $file_name ('f' parameter)
set, which means either tree given by hash or a top tree (and we
currently cannot distinguish between those two cases), we cannot print
path breadcrumbs with git_print_page_path().  Fix this by moving call
to git_print_page_path() inside conditional.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Those two errors were discovered when creating new basic test for
path_info (following). 

I was also thinking about alternate solution of using instead
"$hash_base:$file_name" for $hash, but it caused some errors I didn't
feel like debugging. Current diff is also smaller than mentioned
solution.

BTW. should we use "No such tree" or "No such directory".

 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 18e70a3..bb20ed7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4445,6 +4445,7 @@ sub git_tree {
 			$hash = $hash_base;
 		}
 	}
+	die_error(404, "No such tree") unless defined($hash);
 	$/ = "\0";
 	open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
 		or die_error(500, "Open git-ls-tree failed");
@@ -4485,8 +4486,8 @@ sub git_tree {
 		if ($basedir ne '' && substr($basedir, -1) ne '/') {
 			$basedir .= '/';
 		}
+		git_print_page_path($file_name, 'tree', $hash_base);
 	}
-	git_print_page_path($file_name, 'tree', $hash_base);
 	print "<div class=\"page_body\">\n";
 	print "<table class=\"tree\">\n";
 	my $alternate = 1;

^ permalink raw reply related

* [PATCH] gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh
From: Jakub Narebski @ 2008-10-02 14:52 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski

Note that those tests only that there are no errors nor warnings
from Perl; they do not check for example if gitweb doesn't use
ARRAY(0x8e3cc20) instead of correct value in links, etc.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is the test thans to which I have dicovered errors in git_tree()
fixed in previous email. Nevertheless those two patches are unrelated,
so they are not numbered.

Those tests check _current_ situation, without $action, not
$hash_parent parameters possible in path_info.

 t/t9500-gitweb-standalone-no-errors.sh |   49 ++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 07117a8..64c4cce 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -503,6 +503,55 @@ test_expect_success \
 test_debug 'cat gitweb.log'
 
 # ----------------------------------------------------------------------
+# path_info links
+test_expect_success \
+	'path_info: project' \
+	'gitweb_run "" "/.git"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/branch' \
+	'gitweb_run "" "/.git/b"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/branch:file' \
+	'gitweb_run "" "/.git/master:file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/branch:dir/' \
+	'gitweb_run "" "/.git/master:foo/"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/branch:file (non-existent)' \
+	'gitweb_run "" "/.git/master:non-existent"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/branch:dir/ (non-existent)' \
+	'gitweb_run "" "/.git/master:non-existent/"'
+test_debug 'cat gitweb.log'
+
+
+test_expect_success \
+	'path_info: project/branch:/file' \
+	'gitweb_run "" "/.git/master:/file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/:/file (implicit HEAD)' \
+	'gitweb_run "" "/.git/:/file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'path_info: project/:/ (implicit HEAD, top tree)' \
+	'gitweb_run "" "/.git/:/"'
+test_debug 'cat gitweb.log'
+
+
+# ----------------------------------------------------------------------
 # feed generation
 
 test_expect_success \

^ permalink raw reply related

* Re: How to remove a commit object?
From: Klas Lindberg @ 2008-10-02 14:52 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Jakub Narebski, Steven Grimm, Git Users List
In-Reply-To: <48E4DB21.7020304@drmicha.warpmail.net>

What I really want is to remove files, but when filter-branch didn't
seem to do what I wanted, I turned to the idea of rewriting single
commits to not include the files in question.

This is what I tried with filter-branch: gitk --all shows about 170
commits on directory D in the repo. Of these, maybe 10 don't lead to
HEAD, but dangle off the main track. As a test, I decided to let
filter-branch create a new repo that only contained the contents of
subdirectory B. So I ran

    git-filter-branch --subdirectory-filter B -- --all

and now the resulting repo has just 14 commits. This is clearly not
what I wanted because a lot of the original history for subdirectory B
is just missing.

Actually, in this particular case I get the exact same result with

    git-filter-branch --subdirectory-filter B HEAD

BR / Klas

On Thu, Oct 2, 2008 at 4:30 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Klas Lindberg venit, vidit, dixit 02.10.2008 16:26:
>> Repo size is a problem too, actually.
>>
>> A solution to both problems seemed to be to use git-filter-branch to
>> create a new repo by filtering out all the unwanted files. The
>> astonishing result was that, for the subdirectory I tried it on, 90%
>> or so of the commits on that subdirectory just disappeared. It didn't
>> look right at all. Although I can't say for sure exactly what I did
>> with filter-branch, I would appreciate some guidance for using it. It
>
> I don't know about others, but I would appreciate more info:
> Do you want to remove commits (as stated earlier) or files (as stated here)?
> What are the boundary conditions? Rewriting history seems to be OK now.
>
>> basically seemed to do exactly what I wanted (recreate the repo, minus
>> some explicit stuff, with history intact otherwise), except the result
>> looked crazy.
>
> That may be due to the filter-branch incarnation, i.e. which refs did
> you rewrite (--all or HEAD)?
>
> Michael
>

^ permalink raw reply

* Re: git svn bug?
From: Deskin Miller @ 2008-10-02 14:59 UTC (permalink / raw)
  To: Björn Steinbrink; +Cc: Ark Xu, git
In-Reply-To: <20081002144916.GA3644@atjola.homenet>

On Thu, Oct 2, 2008 at 10:49 AM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> On 2008.10.02 16:50:45 +0800, Ark Xu wrote:
>>   Now I got a tough problem which stopping me for any svn related
>> operations. There is a file log4j.xml that is somehow strange because
>> when I fetch it, i got the following message:
>>
>> tms-service/src/test/resources/log4j.xml has mode 120000 but is not a
>> link at /opt/local/bin/git-svn line 3230.
>> M     tms-service/src/test/resources/log4j.xml
>>
>>   And then, all the operation will lead to :
>> Checksum mismatch: branches/5.3/tms-service/src/test/resources/log4j.xml
>> 51031cbb0e1a2e878e4a3836cf0baa9b80a037a5
>> expected: fab6daef9fc355b9342e26047f5d0141
>>      got: 0e7e9081d608c80d2de0340ba5cd1600
>
> Which git version? And is your /tmp large enough to store that file?

I've had issues similar to this when I did Ctrl+C during git svn
fetch.  Prior to the issue you've pointed out popping up, though, I
could compare the repo against another git svn fetch which was not
interrupted, and the commits would diverge at some point.  When I
looked into the commit which diverged, the commit object was present
in my interrupted repo, but the diff was empty, while it was non-empty
in the other repo.

It seems there's an issue with git svn fetch atomically fetching and
updating its refs.  I've not had time to investigate further, but I
certainly want to.

In the meantime, I worked around it on initial fetch from a big svn
repository by using git svn fetch -r1:n , and increasing n in
increments, so it could run to completion without me interrupting it.

This was seen using git 1.5.4.3 from Ubuntu.

Deskin Miller

^ permalink raw reply

* Re: Help with a tcl/tk gui thing..
From: Mikael Magnusson @ 2008-10-02 15:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0810020746480.3341@nehalem.linux-foundation.org>

2008/10/2 Linus Torvalds <torvalds@linux-foundation.org>:
>
>
> On Thu, 2 Oct 2008, Mikael Magnusson wrote:
>>
>> Heh, sorry, I'm an idiot. I forgot to put '#!/usr/bin/python' on the first
>> line. I was running 'python tracker-ui.py' then did chmod +x just before
>> committing :). So the cross is coming from running 'import time'.
>
> Ahh. It did _something_, so I assumed it was working, just not well. Being
> confused about the language would do it ;)
>
> I fixed it up and merged it as an alternate UI. It doesn't react well to a
> tracker file that has just been initialized with the timeout (but without
> any of the extra information that gets filled out once you actually start
> getting tracked), but it's certainly prettier than my original one.

Ah, I didn't play around too much with the actual server part, but I guess
that would get sort of annoying, so I pushed a fix for that, and also it
now sets the window title right.

I should also note that I'm not exactly a python master, so if it looks ugly,
blame me, not python :).

-- 
Mikael Magnusson

^ permalink raw reply

* Re: How to remove a commit object?
From: Johannes Sixt @ 2008-10-02 15:02 UTC (permalink / raw)
  To: Klas Lindberg
  Cc: Jakub Narebski, Michael J Gruber, Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020726g71c6f39eq16585269fb268322@mail.gmail.com>

Klas Lindberg schrieb:
> A solution to both problems seemed to be to use git-filter-branch to
> create a new repo by filtering out all the unwanted files. The
> astonishing result was that, for the subdirectory I tried it on, 90%
> or so of the commits on that subdirectory just disappeared. It didn't
> look right at all. Although I can't say for sure exactly what I did
> with filter-branch, I would appreciate some guidance for using it. It
> basically seemed to do exactly what I wanted (recreate the repo, minus
> some explicit stuff, with history intact otherwise), except the result
> looked crazy.

And your definition of 'crazy' is...?

I assume that you used --subdirectory-filter. This has issues that will be
fixed in 1.6.1. You need a current 'master' git (at least b805ef08).

-- Hannes

^ permalink raw reply

* Re: [PATCH (BUGFIX)] gitweb: Fix two 'uninitialized value' varnings in git_tree()
From: Giuseppe Bilotta @ 2008-10-02 15:02 UTC (permalink / raw)
  To: git
In-Reply-To: <20081002144602.19247.4434.stgit@localhost.localdomain>

On Thursday 02 October 2008 16:50, Jakub Narebski wrote:

> gitweb: Fix two 'uninitialized value' varnings in git_tree()

Vat's a varning?

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply

* Re: [PATCH] gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh
From: Petr Baudis @ 2008-10-02 15:07 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <20081002145010.19247.44420.stgit@localhost.localdomain>

On Thu, Oct 02, 2008 at 04:52:20PM +0200, Jakub Narebski wrote:
> Note that those tests only that there are no errors nor warnings
> from Perl; they do not check for example if gitweb doesn't use
> ARRAY(0x8e3cc20) instead of correct value in links, etc.
> 
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> This is the test thans to which I have dicovered errors in git_tree()
> fixed in previous email. Nevertheless those two patches are unrelated,
> so they are not numbered.
> 
> Those tests check _current_ situation, without $action, not
> $hash_parent parameters possible in path_info.

I didn't test the patch but it all looks sensible.

Acked-by: Petr Baudis <pasky@suse.cz>

^ permalink raw reply

* Re: [PATCH] git-cvsexportcommit: handle file status reported out of order (was Re: [PATCH] Make git-cvsexportcommit "status" each file in turn)
From: Nick Woolley @ 2008-10-02 15:08 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0810021428170.22125@pacific.mpi-cbg.de.mpi-cbg.de>

Johannes Schindelin wrote:
> Please research a bit better.  If the basenames are not unique, several 
> cvs status calls are used.  See commit
> fef3a7cc5593d3951a5f95c92986fb9982c2cc86.

Yes, I see. I did spend some time searching for prior art on this issue, 
but I obviously wasn't looking in the right places.

> I can only assume that you have not really hung out on this list for very 
> long; this is no way near the way patches are expected here.

Correct.

> Also, given the fact that you actually verified that it was fixed in 
> 1.6.0, what exactly is your proposed course of action?  Revert the fix in 
> 1.6.0 and apply your patch?  Apply your patch to 1.5.6.5, cracking a 
> release 1.5.6.6 with your patch?

Neither. At the moment, I can only offer what I have: a patch for 
1.5.6.5, representing an idea that may contribute something small to 
1.6.0 (using information from CVS on STDERR). It should be simple to 
adapt if it's useful, if not please ignore it.

By posting, I hoped to learn if it was useful and where to look for the 
information I was missing, which you've been helpful enough to point out.

Thanks,

N

^ permalink raw reply

* Re: [PATCH (BUGFIX)] gitweb: Fix two 'uninitialized value' varnings in git_tree()
From: Petr Baudis @ 2008-10-02 15:08 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <20081002144602.19247.4434.stgit@localhost.localdomain>

On Thu, Oct 02, 2008 at 04:50:04PM +0200, Jakub Narebski wrote:
> If we did try to access nonexistent directory or file, which means
> that git_get_hash_by_path() returns `undef`, uninitialized $hash
> variable was passed to 'open' call.  Now we fail early with "404 Not
> Found - No such tree" error.  (If we try to access something which
> does not resolve to tree-ish, for example a file / 'blob' object, the
> error will be caught later, as "404 Not Found - Reading tree failed"
> error).
> 
> If we tried to use 'tree' action without $file_name ('f' parameter)
> set, which means either tree given by hash or a top tree (and we
> currently cannot distinguish between those two cases), we cannot print
> path breadcrumbs with git_print_page_path().  Fix this by moving call
> to git_print_page_path() inside conditional.
> 
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>

Acked-by: Petr Baudis <pasky@suse.cz>

> BTW. should we use "No such tree" or "No such directory".

I prefer the former.

^ permalink raw reply

* [PATCH] gitweb: Support for tag clouds
From: Petr Baudis @ 2008-10-02 15:13 UTC (permalink / raw)
  To: git, git; +Cc: Petr Baudis
In-Reply-To: <"<1222957505-5150-1-git-send-email-pasky@suse.cz>

The "Content tags" (nothing to do with usual Git tags!) are free-form
strings that are attached to random projects and displayed in the
well-known Web2.0-ish tag cloud above project list.

The feature will make use of HTML::TagCloud if available, but will
still display (less pretty) list of tags in case the module is not
installed.

The tagging itself is not done by gitweb - user-provided external
helper CGI needs to be provided; one example is the tagproj.cgi
of Girocco. This functionality might get integrated to gitweb
in the future.

The tags are stored one-per-file in ctags/ subdirectory. The reason
they are not stored in the project config file is that you usually
want to give anyone (even CGI scripts) permission to create new tags
and they are non-essential information, and thus you would make
the ctags/ subdirectory world-writable.

Signed-off-by: Petr Baudis <petr.baudis@novartis.com>

---
 gitweb/gitweb.perl |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index bd8124a..5ba094e 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -275,6 +275,24 @@ our %feature = (
 	'forks' => {
 		'override' => 0,
 		'default' => [0]},
+
+	# Allow gitweb scan project content tags described in ctags/
+	# of project repository, and display the popular Web 2.0-ish
+	# "tag cloud" near the project list. Note that this is something
+	# COMPLETELY different from the normal Git tags.
+
+	# gitweb by itself can show existing tags, but it does not handle
+	# tagging itself; you need an external application for that.
+	# For an example script, check Girocco's cgi/tagproj.cgi.
+	# You may want to install the HTML::TagCloud Perl module to get
+	# a pretty tag cloud instead of just a list of tags.
+
+	# To enable system wide have in $GITWEB_CONFIG
+	# $feature{'ctags'}{'default'} = ['path_to_tag_script'];
+	# Project specific override is not supported.
+	'ctags' => {
+		'override' => 0,
+		'default' => [0]},
 );
 
 sub gitweb_check_feature {
@@ -1755,6 +1773,67 @@ sub git_get_project_description {
 	return $descr;
 }
 
+sub git_get_project_ctags {
+	my $path = shift;
+	my $ctags = {};
+
+	$git_dir = "$projectroot/$path";
+	foreach (<$git_dir/ctags/*>) {
+		open CT, $_ or next;
+		my $val = <CT>;
+		chomp $val;
+		close CT;
+		my $ctag = $_; $ctag =~ s#.*/##;
+		$ctags->{$ctag} = $val;
+	}
+	$ctags;
+}
+
+sub git_populate_project_tagcloud {
+	my $ctags = shift;
+
+	# First, merge different-cased tags; tags vote on casing
+	my %ctags_lc;
+	foreach (keys %$ctags) {
+		$ctags_lc{lc $_}->{count} += $ctags->{$_};
+		if (not $ctags_lc{lc $_}->{topcount}
+		    or $ctags_lc{lc $_}->{topcount} < $ctags->{$_}) {
+			$ctags_lc{lc $_}->{topcount} = $ctags->{$_};
+			$ctags_lc{lc $_}->{topname} = $_;
+		}
+	}
+
+	my $cloud;
+	if (eval { require HTML::TagCloud; 1; }) {
+		$cloud = HTML::TagCloud->new;
+		foreach (sort keys %ctags_lc) {
+			# Pad the title with spaces so that the cloud looks
+			# less crammed.
+			my $title = $ctags_lc{$_}->{topname};
+			$title =~ s/ /&nbsp;/g;
+			$title =~ s/^/&nbsp;/g;
+			$title =~ s/$/&nbsp;/g;
+			$cloud->add($title, $home_link."?by_tag=".$_, $ctags_lc{$_}->{count});
+		}
+	} else {
+		$cloud = \%ctags_lc;
+	}
+	$cloud;
+}
+
+sub git_show_project_tagcloud {
+	my ($cloud, $count) = @_;
+	print STDERR ref($cloud)."..\n";
+	if (ref $cloud eq 'HTML::TagCloud') {
+		return $cloud->html_and_css($count);
+	} else {
+		my @tags = sort { $cloud->{$a}->{count} <=> $cloud->{$b}->{count} } keys %$cloud;
+		return '<p align="center">' . join (', ', map {
+			"<a href=\"$home_link?by_tag=$_\">$cloud->{$_}->{topname}</a>"
+		} splice(@tags, 0, $count)) . '</p>';
+	}
+}
+
 sub git_get_project_url_list {
 	my $path = shift;
 
@@ -3573,6 +3652,7 @@ sub fill_project_list_info {
 	my ($projlist, $check_forks) = @_;
 	my @projects;
 
+	my $show_ctags = gitweb_check_feature('ctags');
  PROJECT:
 	foreach my $pr (@$projlist) {
 		my (@activity) = git_get_last_activity($pr->{'path'});
@@ -3599,6 +3679,7 @@ sub fill_project_list_info {
 				$pr->{'forks'} = 0;
 			}
 		}
+		$show_ctags and $pr->{'ctags'} = git_get_project_ctags($pr->{'path'});
 		push @projects, $pr;
 	}
 
@@ -3645,6 +3726,18 @@ sub git_project_list_body {
 	$from = 0 unless defined $from;
 	$to = $#projects if (!defined $to || $#projects < $to);
 
+	my $show_ctags = gitweb_check_feature('ctags');
+	if ($show_ctags) {
+		my %ctags;
+		foreach my $p (@projects) {
+			foreach my $ct (keys %{$p->{'ctags'}}) {
+				$ctags{$ct} += $p->{'ctags'}->{$ct};
+			}
+		}
+		my $cloud = git_populate_project_tagcloud(\%ctags);
+		print git_show_project_tagcloud($cloud, 64);
+	}
+
 	print "<table class=\"project_list\">\n";
 	unless ($no_header) {
 		print "<tr>\n";
@@ -3663,8 +3756,10 @@ sub git_project_list_body {
 		      "</tr>\n";
 	}
 	my $alternate = 1;
+	my $tagfilter = $cgi->param('by_tag');
 	for (my $i = $from; $i <= $to; $i++) {
 		my $pr = $projects[$i];
+		next if $tagfilter and $show_ctags and not grep { lc $_ eq lc $tagfilter } keys %{$pr->{'ctags'}};
 		if ($alternate) {
 			print "<tr class=\"dark\">\n";
 		} else {
@@ -4086,6 +4181,20 @@ sub git_summary {
 		print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
 		$url_tag = "";
 	}
+
+	# Tag cloud
+	my $show_ctags = (gitweb_check_feature('ctags'))[0];
+	if ($show_ctags) {
+		my $ctags = git_get_project_ctags($project);
+		my $cloud = git_populate_project_tagcloud($ctags);
+		print "<tr id=\"metadata_ctags\"><td>Content tags:<br />";
+		print "</td>\n<td>" unless %$ctags;
+		print "<form action=\"$show_ctags\" method=\"post\"><input type=\"hidden\" name=\"p\" value=\"$project\" />Add: <input type=\"text\" name=\"t\" size=\"8\" /></form>";
+		print "</td>\n<td>" if %$ctags;
+		print git_show_project_tagcloud($cloud, 48);
+		print "</td></tr>";
+	}
+
 	print "</table>\n";
 
 	if (-s "$projectroot/$project/README.html") {
-- 
tg: (c5a1246..) t/tagcloud/tagcloud (depends on: vanilla/master t/summary/css-metadata)

^ permalink raw reply related


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