* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Toralf Förster @ 2008-07-11 14:44 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807111533310.8950@racer>
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]
At Friday 11 July 2008 16:36:07 Johannes Schindelin wrote :
> The question is not so much if it would work, but what people would do
> with this. They would probably include something in a mail to you like
> "v2.6.26-rc9-111 stopped working!", you would test "v2.6.26-rc9-111" and
> go back "but it still works!".
>
> Because you are talking about two different things.
>
> So, in what workflow would v2.6.26-rc9-111 actually be helpful? For
> yourself working in your own lil' branch? I do not think so. HEAD~23 is
> much more helpful in that case, since locally, you do not work so much
> relative to a given tag, but relative to your current HEAD.
>
> Hth,
> Dscho
Ah yes, this clarified it for me.
--
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Dmitry Potapov @ 2008-07-11 14:44 UTC (permalink / raw)
To: Toralf Förster; +Cc: Johannes Schindelin, git
In-Reply-To: <200807111539.06606.toralf.foerster@gmx.de>
On Fri, Jul 11, 2008 at 5:39 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>
> Ok, following the thread I understand why this feature isn't wanted by all. But
> for the given example (where I only pulled from another git tree) this could
> work, isn't it : ?
>
> tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'
No, it does not. Running your script, I have
...
56 commit 803a9067e19714ea7b7da760fe92f0d53bfa6994
...
Now, let's see what git-describe thinks about it
$ git describe 803a9067e19714ea7b7da760fe92f0d53bfa6994
v2.6.26-rc9-38-g803a906
Your script is obviously incorrect. It is written in the assumption that
history is linear, but it is not. Even if you pull only from one repo,
this repo still contains *many* branches. Along any branch, you may have
the same number.
Dmitry
^ permalink raw reply
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Johannes Schindelin @ 2008-07-11 14:36 UTC (permalink / raw)
To: Toralf Förster; +Cc: git
In-Reply-To: <200807111539.06606.toralf.foerster@gmx.de>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1356 bytes --]
Hi,
On Fri, 11 Jul 2008, Toralf Förster wrote:
> At Thursday 10 July 2008 21:29:07 Johannes Schindelin wrote :
>
> > On Thu, 10 Jul 2008, Toralf Förster wrote:
> >
> > > I appended those strings to the names of my UML kernel executables.
> > > Unfortunately I didn't used the commit id and now I'm wondering
> > > whether git could accept v2.6.26-rc9-56 as well in future.
> >
> > If that were unambiguous, yes. But it is not.
>
> Ok, following the thread I understand why this feature isn't wanted by
> all. But for the given example (where I only pulled from another git
> tree) this could work, isn't it : ?
>
> tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'
The question is not so much if it would work, but what people would do
with this. They would probably include something in a mail to you like
"v2.6.26-rc9-111 stopped working!", you would test "v2.6.26-rc9-111" and
go back "but it still works!".
Because you are talking about two different things.
So, in what workflow would v2.6.26-rc9-111 actually be helpful? For
yourself working in your own lil' branch? I do not think so. HEAD~23 is
much more helpful in that case, since locally, you do not work so much
relative to a given tag, but relative to your current HEAD.
Hth,
Dscho
^ permalink raw reply
* Re: [PATCH 0/3] Git::Repo API and gitweb caching
From: Lea Wiemann @ 2008-07-11 14:07 UTC (permalink / raw)
To: Jakub Narebski
Cc: Git Mailing List, John Hawley, Petr Baudis, Johannes Schindelin
In-Reply-To: <200807111133.11662.jnareb@gmail.com>
Jakub Narebski wrote:
> On Fri, 11 July 2008, Lea Wiemann wrote:
>> 1) adding the Mechanize tests,
>
> Somehow I didn't get Cc-ed this patch...
Yup, nobody got Cc'ed; apologies.
> If I remember correctly Mechanize tests detected some bugs in gitweb
> (nice!), but there were swept under the rug, i.e. put as TODO.
>
> Does that mean that those errors were corrected, or that refactoring
> "just" didn't break anything more?
Refactoring really just didn't break anything more; it could be that
something got corrected accidentally, but I'd be surprised.
>> - Benchmarks.
>
> Do you plan to compare other gitweb caching implementations? [k.org, repo.or.cz]
Yup, sure.
>> - Implementing support for Last-Modified or ETags [...] will require
>> mod_perl, since CGI doesn't allow for accessing arbitrary request headers
>
> $requested_language = http('Accept-language');
>
> the header lines received from the client, if any, are placed into the
> environment with the prefix HTTP_ followed by the header name.
Right, you'd think the request headers should be accessible this way,
but apparently not all of them are.
If you take this script, ...
#!/usr/bin/perl
use CGI qw(http);
print "Content-type: text/plain\n";
print "Last-Modified: Thu, 03 Jul 2008 22:39:42 GMT\n\n";
print "Header: ", http('If-Last-Modified');
... then my browser (according to LiveHTTPHeaders) sends an
If-Last-Modified header, but it doesn't get through to the CGI script.
It does work if you test Accept-Language. (Try print `env` to get an
idea of what gets through.) It happens on Apache and thttpd.
Apparently this part somehow applies:
> 'The server may exclude any headers which it has already processed,'
I honestly have no idea why the If-Last-Modified headers gets eaten (and
googling didn't help), but I assume that at least it'll be possible to
access all headers with mod_perl.
> 'If-Not-Modified-Since', 'If-Match' (by caches)
Wait, are you sure caches would use those headers (I believe only the
latter actually exists BTW), or did you fall prey to a thinko? ;)
> one "shortcut" is that gitweb respects HEAD request
> (returning only HTTP headers) for feeds
Yes, and I think it does help performance-wise, but only a really small
fraction of the RSS/Atom requests actually use HEAD. Most use GET.
> I think that ls_tree and git-ls-tree output parsing should be
> generalized into Git::Tree API as well.
True, though I'm still not sure how to make element access work pretty
and fast. I'll keep pondering it for a while.
> I'll try to review the rest of patches by tomorrow...
Thanks!
Johannes Schindelin wrote:
> FWIW there are a few reasons why splitting up (3) might be the thing
> you really want to do
I've put splitting it on my list; I'm not sure though if I'll get around
to doing it today. Everyone, comments on patch (3) are still
appreciated in the meantime. ;-) I'll integrate any suggestions/patches
when I split it up.
-- Lea
^ permalink raw reply
* Re: git pull is slow
From: Johannes Schindelin @ 2008-07-11 14:04 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Stephan Hennig, git
In-Reply-To: <48776169.20705@op5.se>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1923 bytes --]
Hi,
On Fri, 11 Jul 2008, Andreas Ericsson wrote:
> Stephan Hennig wrote:
> > Stephan Hennig schrieb:
> >
> > > I am observing very large data transfers when pulling from the
> > > repository at <URL:http://repo.or.cz/w/wortliste.git>.
> >
> > Here's the output of a recent pull:
> >
> > > unknown@COMMODORE ~/Themen/trennmuster/repository/wortliste (master)
> > > $ git pull
> > > Enter passphrase for key '/x/home/.ssh/id_rsa':
> > > remote: Counting objects: 15, done.←[K
> > > remote: Compressing objects: 100% (7/7), done.←[K) ←[Kts: 8% (1/12)
> > > remote: Total 12 (delta 5), reused 12 (delta 5)←[K
> > > Unpacking objects: 100% (12/12), done.
> > > From git+ssh://xxx@repo.or.cz/srv/git/wortliste
> > > d905095..d0c6a33 master -> origin/master
> > > * [new tag] dehyph-exptl-v0.13 -> dehyph-exptl-v0.13
> > > Updating d905095..d0c6a33
> > > Fast forward
> > > wortliste←[m | 19 ←[32m+++++++++++←[m←[31m--------←[m
> > > 1 files changed, 11 insertions(+), 8 deletions(-)←[m
> >
> > After the line containing "remote: Compressing objects:" had been
> > printed several MB have been transferred.
> >
>
> Seems like you're being bitten by a bug we had some months back,
> where the client requested full history for new tag objects.
I do not think so. I think it is a problem with the pack. The slowness
is already there in the clone, in the resolving phase.
Judging from the output of "verify-pack -v", it seems that the delta
chains are quite long.
I saw memory usage go up pretty quickly. I thought that maybe
eac12e2(Correct pack memory leak causing git gc to try to exceed ulimit)
would help things, since it fixes a place where memory usage grows out of
bounds, but it did not.
Unfortunately, I do not have time to look into this further.
BTW there is a nasty usability bug when "Compressing objects:" and
"Receiving objects:" messages
Ciao,
Dscho
^ permalink raw reply
* Re: feature request: git-log should accept sth like v2.6.26-rc8-227
From: Toralf Förster @ 2008-07-11 13:39 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.1.00.0807102028420.18205@racer>
[-- Attachment #1: Type: text/plain, Size: 842 bytes --]
At Thursday 10 July 2008 21:29:07 Johannes Schindelin wrote :
> Hi,
>
> On Thu, 10 Jul 2008, Toralf Förster wrote:
>
> > I appended those strings to the names of my UML kernel executables.
> > Unfortunately I didn't used the commit id and now I'm wondering whether
> > git could accept v2.6.26-rc9-56 as well in future.
>
> If that were unambiguous, yes. But it is not.
>
> Ciao,
> Dscho
>
Ok, following the thread I understand why this feature isn't wanted by all. But
for the given example (where I only pulled from another git tree) this could
work, isn't it : ?
tfoerste@n22 ~/devel/linux-2.6 $ git-log v2.6.26-rc9.. | perl -e '@c = grep { /^commit/ } <>; print map { $#c - $i++ . "\t" . $_ } @c'
--
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: git pull is slow
From: Andreas Ericsson @ 2008-07-11 13:34 UTC (permalink / raw)
To: Stephan Hennig; +Cc: git
In-Reply-To: <g57jkp$ekm$1@ger.gmane.org>
Stephan Hennig wrote:
> Stephan Hennig schrieb:
>
>> I am observing very large data transfers when pulling from the
>> repository at <URL:http://repo.or.cz/w/wortliste.git>.
>
> Here's the output of a recent pull:
>
>> unknown@COMMODORE ~/Themen/trennmuster/repository/wortliste (master)
>> $ git pull
>> Enter passphrase for key '/x/home/.ssh/id_rsa':
>> remote: Counting objects: 15, done.←[K
>> remote: Compressing objects: 100% (7/7), done.←[K) ←[Kts: 8% (1/12)
>> remote: Total 12 (delta 5), reused 12 (delta 5)←[K
>> Unpacking objects: 100% (12/12), done.
>> From git+ssh://xxx@repo.or.cz/srv/git/wortliste
>> d905095..d0c6a33 master -> origin/master
>> * [new tag] dehyph-exptl-v0.13 -> dehyph-exptl-v0.13
>> Updating d905095..d0c6a33
>> Fast forward
>> wortliste←[m | 19 ←[32m+++++++++++←[m←[31m--------←[m
>> 1 files changed, 11 insertions(+), 8 deletions(-)←[m
>
> After the line containing "remote: Compressing objects:" had been
> printed several MB have been transferred.
>
Seems like you're being bitten by a bug we had some months back,
where the client requested full history for new tag objects.
Does this bug still show up if you use the latest git from
master of git.git?
I *think* v1.5.4.3-440-g41fa7d2 fixed the issue, but I'm
not 100% certain as the commit message doesn't mention anything
about any bugs being solved. Otoh, I vaguely remember the first
bug-reporter being told to try 'next', and afair, that solved it
for him/her.
> Does it matter that the original clone has been performed with plain git
> protocol? I have only later changed the url in .git/config to use git+ssh.
>
No, that doesn't matter in the slightest.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: git pull is slow
From: Stephan Hennig @ 2008-07-11 12:55 UTC (permalink / raw)
To: git
In-Reply-To: <g5570s$d5m$1@ger.gmane.org>
Stephan Hennig schrieb:
> Does it matter that the original clone has been performed with plain git
> protocol? I have only later changed the url in .git/config to use git+ssh.
To be precise, the original pull has been done via
url = git://repo.or.cz/wortliste.git
which is a read-only URL. I changed .git/config manually to point to
url = git+ssh://xxx@repo.or.cz/srv/git/wortliste.git
later, which is the push URL.
Best regards,
Stephan Hennig
^ permalink raw reply
* Re: Ext4 patchqueue corrupted ?
From: Petr Baudis @ 2008-07-11 13:13 UTC (permalink / raw)
To: Theodore Tso
Cc: Aneesh Kumar K.V, Ming Ming Cao, linux-ext4@vger.kernel.org, git
In-Reply-To: <20080711124742.GA20099@mit.edu>
Hi,
On Fri, Jul 11, 2008 at 08:47:42AM -0400, Theodore Tso wrote:
> Can you completely zap the repository replace it with a freshly
> "git init"-ialized files, and I'll try repushing?
right, I have done that now. For anyone interested in the corrupted
repository, the backed up refs and objects directories are still in the
repository under the name *.broken, e.g. at
http://repo.or.cz/r/ext4-patch-queue.git
I will try to analyze it myself later.
--
Petr "Pasky" Baudis
The last good thing written in C++ was the Pachelbel Canon. -- J. Olson
^ permalink raw reply
* Re: Ext4 patchqueue corrupted ?
From: Theodore Tso @ 2008-07-11 12:47 UTC (permalink / raw)
To: Aneesh Kumar K.V
Cc: Petr Baudis, Ming Ming Cao, linux-ext4@vger.kernel.org, git
In-Reply-To: <20080711123109.GA14606@skywalker>
On Fri, Jul 11, 2008 at 06:01:09PM +0530, Aneesh Kumar K.V wrote:
> On Fri, Jul 11, 2008 at 08:26:17AM -0400, Theodore Tso wrote:
> > On Fri, Jul 11, 2008 at 10:47:15AM +0200, Petr Baudis wrote:
> > > very puzzling; I have backed up the broken objects store, can you
> > > repush, please? I'm curious about how this could have happenned;
> > > repo.or.cz now uses Git from latest next, which is a rather strange
> > > coincidence. ;-) Or did any of the pushers do anything special about
> > > pushin to the repository recently?
> >
> > Aneesh, did you try repushing? It looks like the objects store is
> > broken again.
>
> I don't have permission to push to the repo. I can only pull.
Right, sorry, I forgot that you didn't have write access to the repo.
Pasky, my attempt to push is failing:
<tytso@closure> {/usr/projects/linux/ext4/.git/patches/ext4dev} [master]
101% git push git+ssh://repo.or.cz/srv/git/ext4-patch-queue.git master:master
Everything up-to-date
error: refs/tags/v2.6.20-ext4-1 does not point to a valid object!
error: refs/tags/v2.6.20-rc5-ext4-1 does not point to a valid object!
<tytso@closure> {/usr/projects/linux/ext4/.git/patches/ext4dev} [master]
102% git push git+ssh://repo.or.cz/srv/git/ext4-patch-queue.git +refs/heads/*:refs/heads/*
error: refs/tags/v2.6.20-ext4-1 does not point to a valid object!
error: refs/tags/v2.6.20-rc5-ext4-1 does not point to a valid object!
Total 0 (delta 0), reused 0 (delta 0)
error: unpack should have generated a1a5e2eaaea5292da062f6dfbed66b5e07d396d3, but I can't find it!
error: unpack should have generated bd5803bec71c494ba3ac7b147fd4d0deed423a5b, but I can't find it!
To git+ssh://repo.or.cz/srv/git/ext4-patch-queue.git
! [remote rejected] 2.6.23-ext4-1 -> 2.6.23-ext4-1 (bad pack)
! [remote rejected] origin -> origin (bad pack)
error: failed to push some refs to 'git+ssh://repo.or.cz/srv/git/ext4-patch-queue.git'
And git ls-remote tells an even sadder tale:
<tytso@closure> {/usr/projects/linux/ext4/.git/patches/ext4dev} [master]
103% git ls-remote git+ssh://repo.or.cz/srv/git/ext4-patch-queue.git
error: missing object referenced by 'refs/tags/2.6.23-ext4-1'
error: missing object referenced by 'refs/tags/2.6.24-ext4-1'
error: missing object referenced by 'refs/tags/2.6.24-ext4-rc4-1'
error: missing object referenced by 'refs/tags/2.6.24-git12-ext4-1'
error: missing object referenced by 'refs/tags/2.6.24-git6-ext4-1'
error: missing object referenced by 'refs/tags/2.6.24-rc1-ext4-1'
error: missing object referenced by 'refs/tags/2.6.24-rc8-ext4-1'
error: missing object referenced by 'refs/tags/2.6.25-git15-ext4-1'
error: missing object referenced by 'refs/tags/2.6.25-rc4-ext4-1'
error: refs/tags/v2.6.20-ext4-1 does not point to a valid object!
error: refs/tags/v2.6.20-rc5-ext4-1 does not point to a valid object!
error: missing object referenced by 'refs/tags/v2.6.20-rc7-ext4-1'
error: missing object referenced by 'refs/tags/v2.6.21-ext4-1'
error: missing object referenced by 'refs/tags/v2.6.22-rc4-ext4-1'
error: missing object referenced by 'refs/tags/v2.6.26-rc2-ext4-1'
ec90e41198ede71d186bb7075e2edea7a6daae5a HEAD
ec90e41198ede71d186bb7075e2edea7a6daae5a refs/heads/master
346bfccb5d3af0ee5bda961d2e2fcbf1c9d71ef6 refs/tags/2.6.23-ext4-1
47f7b357a1468e42a5d16b9f12ceb9d5c0d1da5e refs/tags/2.6.24-ext4-1
558ca8d2472d43341f80627da9bef266a33e29c1 refs/tags/2.6.24-ext4-rc4-1
0f329cb9046106a0bc2ce1e8ba4a1d431e4761fe refs/tags/2.6.24-git12-ext4-1
fb4f7981226285b1cd9230bd584ad8c442441fd1 refs/tags/2.6.24-git6-ext4-1
04ccbce687206f51e8e2d243505381c0da48db2b refs/tags/2.6.24-rc1-ext4-1
058e44f59dc308408ac3558f7d375b1c55e429fe refs/tags/2.6.24-rc8-ext4-1
419fe473159404c4ce0a516e3d435705271de3d8 refs/tags/2.6.25-git15-ext4-1
fe39106438de15396a7083d11cbc1f1511006382 refs/tags/2.6.25-rc4-ext4-1
dfc7edaaea270f4182d748de59ef83d3b679c54b refs/tags/v2.6.20-rc7-ext4-1
fb7f3bc312359e429a7308bf0fcffeb920ab2efc refs/tags/v2.6.21-ext4-1
0db80f52ee3366cae5a0c3276be2f7de1674b09b refs/tags/v2.6.22-rc4-ext4-1
be15cbe06b269fcacb80b8d8484ec606f5788de1 refs/tags/v2.6.26-rc2-ext4-1
Can you completely zap the repository replace it with a freshly
"git init"-ialized files, and I'll try repushing?
Thanks!!
- Ted
^ permalink raw reply
* Re: Ext4 patchqueue corrupted ?
From: Aneesh Kumar K.V @ 2008-07-11 12:31 UTC (permalink / raw)
To: Theodore Tso; +Cc: Petr Baudis, Ming Ming Cao, linux-ext4@vger.kernel.org, git
In-Reply-To: <20080711122617.GA8154@mit.edu>
On Fri, Jul 11, 2008 at 08:26:17AM -0400, Theodore Tso wrote:
> On Fri, Jul 11, 2008 at 10:47:15AM +0200, Petr Baudis wrote:
> > very puzzling; I have backed up the broken objects store, can you
> > repush, please? I'm curious about how this could have happenned;
> > repo.or.cz now uses Git from latest next, which is a rather strange
> > coincidence. ;-) Or did any of the pushers do anything special about
> > pushin to the repository recently?
>
> Aneesh, did you try repushing? It looks like the objects store is
> broken again.
I don't have permission to push to the repo. I can only pull.
>
> Pasky, in case it helps, and for the benefit of Linux-ext4 folks, I
> have a copy of my repository (which I last pushed to repo.or.cz around
> noon US/Eastern yesterday) here:
>
> git://git.kernel.org/pub/scm/fs/ext2/ext4-patch-queue.git
>
> My most recent HEAD is ec90e411; if anyone has something more recent,
> they can send it to me via:
>
> git bundle create /tmp/to-send ec90e411
>
> ... and then e-mailing me as an attachment the resulting binary file
> in /tmp/to-send.
>
-aneesh
^ permalink raw reply
* Re: jgit (was: [PATCH 4/4] Add a method...)
From: Robin Rosenberg @ 2008-07-11 12:24 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Shawn O. Pearce, git, Marek Zawirski
In-Reply-To: <487750E3.90303@op5.se>
fredagen den 11 juli 2008 14.24.03 skrev Andreas Ericsson:
> Sorry for butting in, but I'd appreciate if you kept adding 'jgit'
> to the subject so I can keep filtering these patches out. The volume
> on git@vger is high enough without having to follow off-shoots that
> are of no particular concern to me (although I certainly applaud the
> effort).
It was an accident. Honestly :)
-- robin
^ permalink raw reply
* Re: git pull is slow
From: Stephan Hennig @ 2008-07-11 12:25 UTC (permalink / raw)
To: git
In-Reply-To: <g5570s$d5m$1@ger.gmane.org>
Stephan Hennig schrieb:
> I am observing very large data transfers when pulling from the
> repository at <URL:http://repo.or.cz/w/wortliste.git>.
Here's the output of a recent pull:
> unknown@COMMODORE ~/Themen/trennmuster/repository/wortliste (master)
> $ git pull
> Enter passphrase for key '/x/home/.ssh/id_rsa':
> remote: Counting objects: 15, done.←[K
> remote: Compressing objects: 100% (7/7), done.←[K) ←[Kts: 8% (1/12)
> remote: Total 12 (delta 5), reused 12 (delta 5)←[K
> Unpacking objects: 100% (12/12), done.
> From git+ssh://xxx@repo.or.cz/srv/git/wortliste
> d905095..d0c6a33 master -> origin/master
> * [new tag] dehyph-exptl-v0.13 -> dehyph-exptl-v0.13
> Updating d905095..d0c6a33
> Fast forward
> wortliste←[m | 19 ←[32m+++++++++++←[m←[31m--------←[m
> 1 files changed, 11 insertions(+), 8 deletions(-)←[m
After the line containing "remote: Compressing objects:" had been
printed several MB have been transferred.
Does it matter that the original clone has been performed with plain git
protocol? I have only later changed the url in .git/config to use git+ssh.
Best regards,
Stephan Hennig
^ permalink raw reply
* Re: Ext4 patchqueue corrupted ?
From: Theodore Tso @ 2008-07-11 12:26 UTC (permalink / raw)
To: Petr Baudis
Cc: Aneesh Kumar K.V, Ming Ming Cao, linux-ext4@vger.kernel.org, git
In-Reply-To: <20080711084715.GT10151@machine.or.cz>
On Fri, Jul 11, 2008 at 10:47:15AM +0200, Petr Baudis wrote:
> very puzzling; I have backed up the broken objects store, can you
> repush, please? I'm curious about how this could have happenned;
> repo.or.cz now uses Git from latest next, which is a rather strange
> coincidence. ;-) Or did any of the pushers do anything special about
> pushin to the repository recently?
Aneesh, did you try repushing? It looks like the objects store is
broken again.
Pasky, in case it helps, and for the benefit of Linux-ext4 folks, I
have a copy of my repository (which I last pushed to repo.or.cz around
noon US/Eastern yesterday) here:
git://git.kernel.org/pub/scm/fs/ext2/ext4-patch-queue.git
My most recent HEAD is ec90e411; if anyone has something more recent,
they can send it to me via:
git bundle create /tmp/to-send ec90e411
... and then e-mailing me as an attachment the resulting binary file
in /tmp/to-send.
- Ted
^ permalink raw reply
* jgit (was: [PATCH 4/4] Add a method...)
From: Andreas Ericsson @ 2008-07-11 12:24 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Shawn O. Pearce, git, Marek Zawirski
In-Reply-To: <1215769719-5238-1-git-send-email-robin.rosenberg@dewire.com>
Sorry for butting in, but I'd appreciate if you kept adding 'jgit'
to the subject so I can keep filtering these patches out. The volume
on git@vger is high enough without having to follow off-shoots that
are of no particular concern to me (although I certainly applaud the
effort).
Thanks
Robin Rosenberg wrote:
[ a patch for jgit ]
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: Should we discuss Windows-related changes on git@vger.kernel.org?
From: Johannes Schindelin @ 2008-07-11 11:56 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Johannes Sixt, Junio C Hamano, msysGit, Git Mailing List
In-Reply-To: <DDFD7E3B-8401-4EA0-9BBA-C9D8E25998A3@zib.de>
Hi,
On Fri, 11 Jul 2008, Steffen Prohaska wrote:
> I decided to stop queuing changes in 4msysgit. Instead I'd like to
> bring the diff between Junio's and 4msysgit's master to zero. This
> seems to be achievable after Junio merged Hannes' MinGW changes.
>
> I think all Windows-related changes to the git code base could be
> discussed directly on the main git list and the msysgit list would be
> reserved for the MinGW/MSYS runtime environment and the installer.
I disagree. Judging from the mails I read on the git list, Junio gets
really swamped by patches these days (what with our very productive GSoC
students).
I really think that we should discuss the patches on the msysGit list
first, whip them into shape, and then send them off.
Just think of those patches that were sent off, only to realize that they
were no longer needed. That should not have happened.
My 2p,
Dscho
^ permalink raw reply
* Re: Errors importing Apache Synapse SVN using Git
From: Michael J Gruber @ 2008-07-11 11:54 UTC (permalink / raw)
To: git; +Cc: Eric Wong
In-Reply-To: <4875FA23.30603@wso2.com>
Asankha C. Perera venit, vidit, dixit 10.07.2008 14:01:
> Hi All
>
> I am an Apache Synapse developer, and want to import the Synapse SVN
> repo into Git, so that Ohloh can properly get the Synapse history
> (http://www.ohloh.net/topics/1326?page=1#post_6287)
>
> However, when I try the command: "git svn clone --trunk=trunk
> --tags=tags --branches=branches http://svn.apache.org/repos/asf/synapse"
> it seems to take forever, (or at least until the next network glitch),
> and keeps filling up a file with just plain zeros ("0") :
> ./.git/svn/trunk/.rev_db.13f79535-47bb-0310-9956-ffa450edef68
Okay, besides the zero offset, there seems to be big problem with the
svn repo:
svn list -r 234478 http://svn.apache.org/repos/asf/synapse
branches/
site/
tags/
trunk/
svn list -r 234478 http://svn.apache.org/repos/asf|grep synapse
Right, nothing returned.
git-svn insists on using http://svn.apache.org/repos/asf as the base
URL, which is basically correct, but doesn't work for this repo.
Even editing .git/config and .git/svn/metadata (after git svn init,
befire the first fetch) to change the url doesn't help. git svn still
uses .../asf. Is this as intended? cc'ing the git svn author.
Michael
^ permalink raw reply
* Re: [PATCH] bisect: test merge base if good rev is not an ancestor of bad rev
From: Johannes Schindelin @ 2008-07-11 11:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Michael Haggerty, Jeff King, git
In-Reply-To: <7vabgolxqa.fsf@gitster.siamese.dyndns.org>
Hi,
On Thu, 10 Jul 2008, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > On Thu, 10 Jul 2008, Junio C Hamano wrote:
> >
> >> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >>
> > Of course it can be that the user commits a pilot error and says "but
> > that unrelated version was good", while the fork point(s) between good
> > and bad was bad (and this might be even the intention of the user, to
> > find _one_ commit that introduced the bug).
> >
> > Speaking of plural, what if some of the merge bases are good, some are
> > bad?
> >
> > Without carefully thinking it through, you might even _break_ the tool.
>
> And you think it is better to make all of your _users_ think it through
> every time? Isn't it more error prone?
Maybe I am alone here, but except for that occasion that triggered my
"fixed/unfixed" patch, I did have to think, in order to use git-bisect. I
said "git bisect start && git bisect bad HEAD && git bisect good
HEAD@{1.day.ago}", and then follow the instructions.
> > All I was proposing is keeping the current semantics, keeping the
> > mechanism simple, and therefore reliable.
>
> What I suggested to Christian (sorry, I've been busy and I still haven't
> checked if that is what was implemented in the patch -- that is why I
> suggested you to read the original thread) was:
>
> - check good and bad to see if they are forked
>
> - iff they are,
>
> - have the user check merge bases and make sure they are all
> good. otherwise, the initial good/bad pair is unsuitable for
> bisection, so explain the situation and quit [*1*];
>
> - otherwise, keep these good markers.
>
> - do the usual bisection --- from this point on it is "simple and
> reliable as it has always been".
Okay, that seems like a trivial and good patch.
> *1* We _could_ make things more complex by offering to swap good and bad
> at this point and then continue bisecting to find a commit to cherry-pick
> to forward port the fix. Arguably, that step would be a new code and
> could start out to be buggy --- it _could_ be called destabilizing what
> has been reliable, but even then, it would be a separate codepath and a
> new bug will be something that triggers only when the user accepts that
> offer. I do not see what the big deal is that you seem to be worried
> about.
That is what I am actually scared off. That in the wake of a nice and
trivial patch, things get muddied and complicated like back when "rebase
-i -m" was made unusable for the layman.
Ciao,
Dscho
^ permalink raw reply
* Re: [EGIT PATCH 2/6] Using the page site selection turned out to be cumbersome.
From: Johannes Schindelin @ 2008-07-11 11:14 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Robin Rosenberg, git, Marek Zawirski
In-Reply-To: <20080711035249.GA32652@spearce.org>
Hi,
On Fri, 11 Jul 2008, Shawn O. Pearce wrote:
> "Shawn O. Pearce" <spearce@spearce.org> wrote:
> > Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> >
> > > + <action
> > > + class="org.spearce.egit.ui.internal.actions.ResetAction"
> > > + id="org.spearce.egit.ui.action1"
> > > + label="Titta"
Just in case somebody thought Robin tried to slip in a perverse word: not
so. In Swedish, "Titta" means "look!".
Ciao,
Dscho
^ permalink raw reply
* Differences between git-applu and GNU patch (was: [JGIT PATCH 1/1] jgit: create a tag command)
From: Jakub Narebski @ 2008-07-11 10:50 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Mike Ralphson, Shawn O. Pearce, Marek Zawirski, git
In-Reply-To: <200807102002.11044.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
> torsdagen den 10 juli 2008 17.31.06 skrev Mike Ralphson:
> >
> > Apologies this will be whitespace damaged, but it's trivial.
>
> Don't do like that again : Had to use patch -l to apply this.
> Why doesn't git am have that?
It is not git-am that should have implemented -l / --ignore-whitespace
option, but git-apply... well, beside passing it to git-apply of course.
I tried to look up how git-apply is implemented (builtin-apply.c),
but it looks like it implements patching itself, and I am not familiar
at all with this code... BTW. why applying patch is not left to xdiff
code?
It would be nice if git-apply implemented larger subset of GNU patch
options, for example --dry-run (which is similar but I think not
exactly the same as --check), --fuzz=<num> (how it differs from -C<n>?)
--strip=<num> as equivalent to -p<n>, -l / --ignore-whitespace,
--reject-file=<rejectfile> together with --reject...
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH 4/4] Add a method to listen to changes in any repository
From: Robin Rosenberg @ 2008-07-11 9:48 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <20080711042822.GC32633@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/jgit/lib/Repository.java | 39 ++++++++++++++++++--
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 52f6750..af860b3 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -95,6 +95,7 @@ public class Repository {
private GitIndex index;
private List<RepositoryListener> listeners = new Vector<RepositoryListener>(); // thread safe
+ static private List<RepositoryListener> allListeners = new Vector<RepositoryListener>(); // thread safe
/**
* Construct a representation of a Git repository.
@@ -1051,12 +1052,36 @@ public class Repository {
listeners.remove(l);
}
+ /**
+ * Register a global {@link RepositoryListener} which will be notified
+ * when a ref changes in any repository are detected.
+ *
+ * @param l
+ */
+ public static void addAnyRepositoryChangedListener(final RepositoryListener l) {
+ allListeners.add(l);
+ }
+
+ /**
+ * Remove a globally registered {@link RepositoryListener}
+ * @param l
+ */
+ public static void removeAnyRepositoryChangedListener(final RepositoryListener l) {
+ allListeners.remove(l);
+ }
+
void fireRefsMaybeChanged() {
if (refs.lastRefModification != refs.lastNotifiedRefModification) {
refs.lastNotifiedRefModification = refs.lastRefModification;
final RefsChangedEvent event = new RefsChangedEvent(this);
- for (final RepositoryListener l :
- listeners.toArray(new RepositoryListener[0])) {
+ List<RepositoryListener> all;
+ synchronized (listeners) {
+ all = new ArrayList<RepositoryListener>(listeners);
+ }
+ synchronized (allListeners) {
+ all.addAll(allListeners);
+ }
+ for (final RepositoryListener l : all) {
l.refsChanged(event);
}
}
@@ -1064,8 +1089,14 @@ public class Repository {
void fireIndexChanged() {
final IndexChangedEvent event = new IndexChangedEvent(this);
- for (final RepositoryListener l :
- listeners.toArray(new RepositoryListener[0])) {
+ List<RepositoryListener> all;
+ synchronized (listeners) {
+ all = new ArrayList<RepositoryListener>(listeners);
+ }
+ synchronized (allListeners) {
+ all.addAll(allListeners);
+ }
+ for (final RepositoryListener l : all) {
l.indexChanged(event);
}
}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* [PATCH 7/7] Add a job to refresh projects when the index changes.
From: Robin Rosenberg @ 2008-07-11 9:32 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <20080711043317.GD32633@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../src/org/spearce/egit/ui/Activator.java | 85 +++++++++++++++++++-
1 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
index 3e02c44..89e6579 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
@@ -11,16 +11,20 @@ package org.spearce.egit.ui;
import java.net.Authenticator;
import java.net.ProxySelector;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.Set;
import org.eclipse.core.net.proxy.IProxyService;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jsch.core.IJSchService;
@@ -30,7 +34,10 @@ import org.eclipse.ui.themes.ITheme;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.spearce.egit.core.project.RepositoryMapping;
+import org.spearce.jgit.lib.IndexChangedEvent;
+import org.spearce.jgit.lib.RefsChangedEvent;
import org.spearce.jgit.lib.Repository;
+import org.spearce.jgit.lib.RepositoryListener;
import org.spearce.jgit.transport.SshSessionFactory;
/**
@@ -137,6 +144,7 @@ public class Activator extends AbstractUIPlugin {
private boolean traceVerbose;
private RCS rcs;
+ private RIRefresh refreshJob;
/**
* Constructor for the egit ui plugin singleton
@@ -151,6 +159,71 @@ public class Activator extends AbstractUIPlugin {
setupSSH(context);
setupProxy(context);
setupRepoChangeScanner();
+ setupRepoIndexRefresh();
+ }
+
+ private void setupRepoIndexRefresh() {
+ refreshJob = new RIRefresh();
+ Repository.addAnyRepositoryChangedListener(refreshJob);
+ }
+
+ static class RIRefresh extends Job implements RepositoryListener {
+
+ RIRefresh() {
+ super("Git index refresh Job");
+ }
+
+ private Set<IProject> projectsToScan = new LinkedHashSet<IProject>();
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ monitor.beginTask("Refreshing git managed projects", projects.length);
+
+ while (projectsToScan.size() > 0) {
+ IProject p;
+ synchronized (projectsToScan) {
+ if (projectsToScan.size() == 0)
+ break;
+ Iterator<IProject> i = projectsToScan.iterator();
+ p = i.next();
+ i.remove();
+ }
+ ISchedulingRule rule = p.getWorkspace().getRuleFactory().refreshRule(p);
+ try {
+ getJobManager().beginRule(rule, monitor);
+ p.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
+ } catch (CoreException e) {
+ logError("Failed to refresh projects from index changes", e);
+ return new Status(IStatus.ERROR, getPluginId(), e.getMessage());
+ } finally {
+ getJobManager().endRule(rule);
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ public void indexChanged(IndexChangedEvent e) {
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ Set<IProject> toRefresh= new HashSet<IProject>();
+ for (IProject p : projects) {
+ RepositoryMapping mapping = RepositoryMapping.getMapping(p);
+ if (mapping != null && mapping.getRepository() == e.getRepository()) {
+ toRefresh.add(p);
+ }
+ }
+ synchronized (projectsToScan) {
+ projectsToScan.addAll(toRefresh);
+ }
+ if (projectsToScan.size() > 0)
+ schedule();
+ }
+
+ public void refsChanged(RefsChangedEvent e) {
+ // Do not react here
+ }
+
}
static class RCS extends Job {
@@ -236,10 +309,14 @@ public class Activator extends AbstractUIPlugin {
public void stop(final BundleContext context) throws Exception {
trace("Trying to cancel " + rcs.getName() + " job");
- if (!rcs.cancel()) {
- rcs.join();
- }
- trace("rcs.getName() " + rcs.getName() + " cancelled ok");
+ rcs.cancel();
+ trace("Trying to cancel " + refreshJob.getName() + " job");
+ refreshJob.cancel();
+
+ rcs.join();
+ refreshJob.join();
+
+ trace("Jobs terminated");
super.stop(context);
plugin = null;
}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* Re: [PATCH 0/3] Git::Repo API and gitweb caching
From: Jakub Narebski @ 2008-07-11 9:33 UTC (permalink / raw)
To: Lea Wiemann; +Cc: Git Mailing List, John Hawley, Petr Baudis
In-Reply-To: <4876B223.4070707@gmail.com>
On Fri, 11 July 2008, Lea Wiemann wrote:
> As follow-ups to this message, I'll be sending three patches for
>
> 1) adding the Mechanize tests,
Somehow I didn't get Cc-ed this patch...
> The Mechanize tests succeed before and after patch (3) is applied, so
> I'm reasonably confident that my refactoring didn't introduce any
> (major) bugs.
If I remember correctly Mechanize tests detected some bugs in gitweb
(nice!), but there were swept under the rug, i.e. put as TODO.
Does that mean that those errors were corrected, or that refactoring
"just" didn't break anything more?
> On my to-do list:
>
> - Benchmarks. I'm planning to time a replay of kernel.org's gitweb logs
> on the test server, with and without caching. Nothing fancy. (The
> performance of the test setup on odin3.kernel.org is not representative
> of gitweb's actual performance under load.)
Do you plan to compare other gitweb caching implementations? I mean
here old kernel.org caching by J.H., and repo.or.cz caching (only for
projects list page) by Pasky.
> - Implement support for Last-Modified or ETags, since those basically
> fall out for free with the current implementation. (This will require
> mod_perl, since CGI doesn't allow for accessing arbitrary request
> headers AFAIK.)
>From CGI(3pm):
http()
Called with no arguments returns the list of HTTP environment vari-
ables, including such things as HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE,
and HTTP_ACCEPT_CHARSET, corresponding to the like-named HTTP header
fields in the request. Called with the name of an HTTP header field,
returns its value. Capitalization and the use of hyphens versus under-
scores are not significant.
For example, all three of these examples are equivalent:
$requested_language = http('Accept-language');
$requested_language = http('Accept_language');
$requested_language = http('HTTP_ACCEPT_LANGUAGE');
>From http://hoohoo.ncsa.uiuc.edu/cgi/env.html
In addition to these, the header lines received from the client, if
any, are placed into the environment with the prefix HTTP_ followed
by the header name. Any '-' characters in the header name are changed
to '_' characters. The server may exclude any headers which it has
already processed, such as Authorization, Content-type, and
Content-length. If necessary, the server may choose to exclude any
or all of these headers if including them would exceed any system
environment limits.
So you _can_ access 'If-Modified-Since', 'If-None-Match' (by web browsers)
and 'If-Not-Modified-Since', 'If-Match' (by caches) from CGI.
> That will make the site a tad more responsive, I hope,
> and it will also hugely reduce the load for RSS/Atom requests, which
> currently make up almost half of all requests to kernel.org's gitweb and
> get served in full each time (i.e. "200 OK" instead of "304 Not Modified").
Currently only one "shortcut" is that gitweb respects HEAD request
(returning only HTTP headers) for feeds, and if I remember correctly
only for feeds. I don't know however how much work gitweb does before
HEAD request shortcut.
> - Make gitweb use more parts of the Git::Repo API; in particular, the
> commit and tag parsing code should be ripped out, and gitweb should use
> the (much prettier) Git::Commit/Git::Tag API instead. Perhaps some more
> functions (like ls_tree) can be generalized into the API as well; I went
> the easy route for now and simply replaced most "open '-|'" calls with
> $repo->cmd_output calls.
I think that ls_tree and git-ls-tree output parsing should be
generalized into Git::Tree API as well.
I'll try to review the rest of patches by tomorrow...
--
Jakub Narebski
Poland
^ permalink raw reply
* [PATCH] Create a listener structure for changes to refs and index
From: Robin Rosenberg @ 2008-07-11 9:27 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git, Marek Zawirski, Robin Rosenberg
In-Reply-To: <20080711042251.GB32633@spearce.org>
This version does not tell you which refs have changed, nor
what changes have happened. There is not scanning for externally
initiated changes either, though such changes can be found when
a JGit client wants to read index or refs information.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
.../egit/ui/internal/history/GitHistoryPage.java | 31 +++++++++-
.../src/org/spearce/jgit/lib/GitIndex.java | 3 +
.../org/spearce/jgit/lib/IndexChangedEvent.java | 55 +++++++++++++++++
.../src/org/spearce/jgit/lib/RefDatabase.java | 19 ++++++
.../src/org/spearce/jgit/lib/RefsChangedEvent.java | 55 +++++++++++++++++
.../src/org/spearce/jgit/lib/Repository.java | 41 +++++++++++++
.../org/spearce/jgit/lib/RepositoryAdapter.java | 54 ++++++++++++++++
.../spearce/jgit/lib/RepositoryChangedEvent.java | 64 ++++++++++++++++++++
.../org/spearce/jgit/lib/RepositoryListener.java | 63 +++++++++++++++++++
9 files changed, 384 insertions(+), 1 deletions(-)
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/IndexChangedEvent.java
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/RefsChangedEvent.java
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryAdapter.java
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryChangedEvent.java
create mode 100644 org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryListener.java
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
index 6b55185..7e2f726 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/history/GitHistoryPage.java
@@ -61,7 +61,10 @@ import org.spearce.egit.ui.UIIcons;
import org.spearce.egit.ui.UIPreferences;
import org.spearce.egit.ui.UIText;
import org.spearce.jgit.lib.AnyObjectId;
+import org.spearce.jgit.lib.IndexChangedEvent;
+import org.spearce.jgit.lib.RefsChangedEvent;
import org.spearce.jgit.lib.Repository;
+import org.spearce.jgit.lib.RepositoryListener;
import org.spearce.jgit.revplot.PlotCommit;
import org.spearce.jgit.revwalk.RevCommit;
import org.spearce.jgit.revwalk.RevFlag;
@@ -73,7 +76,7 @@ import org.spearce.jgit.treewalk.filter.PathFilterGroup;
import org.spearce.jgit.treewalk.filter.TreeFilter;
/** Graphical commit history viewer. */
-public class GitHistoryPage extends HistoryPage {
+public class GitHistoryPage extends HistoryPage implements RepositoryListener {
private static final String PREF_COMMENT_WRAP = UIPreferences.RESOURCEHISTORY_SHOW_COMMENT_WRAP;
private static final String PREF_COMMENT_FILL = UIPreferences.RESOURCEHISTORY_SHOW_COMMENT_FILL;
@@ -230,6 +233,32 @@ public class GitHistoryPage extends HistoryPage {
layout();
}
+ private Runnable refschangedRunnable;
+
+ public void refsChanged(final RefsChangedEvent e) {
+ if (getControl().isDisposed())
+ return;
+
+ synchronized (this) {
+ if (refschangedRunnable == null) {
+ refschangedRunnable = new Runnable() {
+ public void run() {
+ if (!getControl().isDisposed()) {
+ Activator.trace("Executing async repository changed event");
+ refschangedRunnable = null;
+ inputSet();
+ }
+ }
+ };
+ getControl().getDisplay().asyncExec(refschangedRunnable);
+ }
+ }
+ }
+
+ public void indexChanged(final IndexChangedEvent e) {
+ // We do not use index information here now
+ }
+
private void finishContextMenu() {
popupMgr.add(new Separator());
popupMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
index 5be404e..c7a4402 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java
@@ -146,6 +146,7 @@ public class GitIndex {
public void rereadIfNecessary() throws IOException {
if (cacheFile.exists() && cacheFile.lastModified() != lastCacheTime) {
read();
+ db.fireIndexChanged();
}
}
@@ -269,6 +270,8 @@ public class GitIndex {
"Could not rename temporary index file to index");
changed = false;
statDirty = false;
+ lastCacheTime = cacheFile.lastModified();
+ db.fireIndexChanged();
} finally {
if (!lock.delete())
throw new IOException(
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/IndexChangedEvent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/IndexChangedEvent.java
new file mode 100644
index 0000000..30a40d1
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/IndexChangedEvent.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Git Development Community nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.spearce.jgit.lib;
+
+/**
+ * This class passes information about a changed Git index to a
+ * {@link RepositoryListener}
+ *
+ * Currently only a reference to the repository is passed.
+ */
+public class IndexChangedEvent extends RepositoryChangedEvent {
+ IndexChangedEvent(final Repository repository) {
+ super(repository);
+ }
+
+ @Override
+ public String toString() {
+ return "IndexChangedEvent[" + getRepository() + "]";
+ }
+}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
index 9e3e020..ebfa7f5 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefDatabase.java
@@ -81,6 +81,12 @@ class RefDatabase {
private long packedRefsLength;
+ long lastRefModification;
+
+ long lastNotifiedRefModification;
+
+ static int refModificationCounter;
+
RefDatabase(final Repository r) {
db = r;
gitDir = db.getDirectory();
@@ -132,6 +138,8 @@ class RefDatabase {
void stored(final String name, final ObjectId id, final long time) {
looseRefs.put(name, new CachedRef(Ref.Storage.LOOSE, name, id, time));
+ setModified();
+ db.fireRefsMaybeChanged();
}
/**
@@ -155,6 +163,12 @@ class RefDatabase {
}
if (!lck.commit())
throw new ObjectWritingException("Unable to write " + name);
+ setModified();
+ db.fireRefsMaybeChanged();
+ }
+
+ void setModified() {
+ lastRefModification = refModificationCounter++;
}
Ref readRef(final String partialName) throws IOException {
@@ -192,6 +206,7 @@ class RefDatabase {
readPackedRefs(avail);
readLooseRefs(avail, REFS_SLASH, refsDir);
readOneLooseRef(avail, Constants.HEAD, new File(gitDir, Constants.HEAD));
+ db.fireRefsMaybeChanged();
return avail;
}
@@ -321,6 +336,8 @@ class RefDatabase {
return r != null ? r : new Ref(Ref.Storage.LOOSE, target, null);
}
+ setModified();
+
final ObjectId id;
try {
id = ObjectId.fromString(line);
@@ -378,6 +395,7 @@ class RefDatabase {
packedRefsLastModified = currTime;
packedRefsLength = currLen;
packedRefs = newPackedRefs;
+ setModified();
} catch (FileNotFoundException noPackedRefs) {
// Ignore it and leave the new map empty.
//
@@ -414,4 +432,5 @@ class RefDatabase {
lastModified = mtime;
}
}
+
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefsChangedEvent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefsChangedEvent.java
new file mode 100644
index 0000000..c8936c7
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefsChangedEvent.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Git Development Community nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.spearce.jgit.lib;
+
+/**
+ * This class passes information about a changed Git index to a
+ * {@link RepositoryListener}
+ *
+ * Currently only a reference to the repository is passed.
+ */
+public class RefsChangedEvent extends RepositoryChangedEvent {
+ RefsChangedEvent(final Repository repository) {
+ super(repository);
+ }
+
+ @Override
+ public String toString() {
+ return "RefsChangedEvent[" + getRepository() + "]";
+ }
+}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
index 04d9b13..6f78652 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -49,7 +49,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
+import java.util.Vector;
import org.spearce.jgit.errors.IncorrectObjectTypeException;
import org.spearce.jgit.errors.RevisionSyntaxException;
@@ -92,6 +94,8 @@ public class Repository {
private GitIndex index;
+ private List<RepositoryListener> listeners = new Vector<RepositoryListener>(); // thread safe
+
/**
* Construct a representation of a Git repository.
*
@@ -1028,4 +1032,41 @@ public class Repository {
public File getWorkDir() {
return getDirectory().getParentFile();
}
+
+ /**
+ * Register a {@link RepositoryListener} which will be notified
+ * when ref changes are detected.
+ *
+ * @param l
+ */
+ public void addRepositoryChangedListener(final RepositoryListener l) {
+ listeners.add(l);
+ }
+
+ /**
+ * Remove a registered {@link RepositoryListener}
+ * @param l
+ */
+ public void removeRepositoryChangedListener(final RepositoryListener l) {
+ listeners.remove(l);
+ }
+
+ void fireRefsMaybeChanged() {
+ if (refs.lastRefModification != refs.lastNotifiedRefModification) {
+ refs.lastNotifiedRefModification = refs.lastRefModification;
+ final RefsChangedEvent event = new RefsChangedEvent(this);
+ for (final RepositoryListener l :
+ listeners.toArray(new RepositoryListener[listeners.size()])) {
+ l.refsChanged(event);
+ }
+ }
+ }
+
+ void fireIndexChanged() {
+ final IndexChangedEvent event = new IndexChangedEvent(this);
+ for (final RepositoryListener l :
+ listeners.toArray(new RepositoryListener[listeners.size()])) {
+ l.indexChanged(event);
+ }
+ }
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryAdapter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryAdapter.java
new file mode 100644
index 0000000..d1ff07d
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryAdapter.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Git Development Community nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.spearce.jgit.lib;
+
+/**
+ * A default {@link RepositoryListener} that does nothing except invoke an
+ * optional general method for any repository change.
+ */
+public class RepositoryAdapter implements RepositoryListener {
+
+ public void indexChanged(final IndexChangedEvent e) {
+ // Empty
+ }
+
+ public void refsChanged(final RefsChangedEvent e) {
+ // Empty
+ }
+
+}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryChangedEvent.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryChangedEvent.java
new file mode 100644
index 0000000..b58df87
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryChangedEvent.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Git Development Community nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.spearce.jgit.lib;
+
+/**
+ * This class passes information about changed refs to a
+ * {@link RepositoryListener}
+ *
+ * Currently only a reference to the repository is passed.
+ */
+public class RepositoryChangedEvent {
+ private final Repository repository;
+
+ RepositoryChangedEvent(final Repository repository) {
+ this.repository = repository;
+ }
+
+ /**
+ * @return the repository that was changed
+ */
+ public Repository getRepository() {
+ return repository;
+ }
+
+ @Override
+ public String toString() {
+ return "RepositoryChangedEvent[" + repository + "]";
+ }
+}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryListener.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryListener.java
new file mode 100644
index 0000000..ceb14ce
--- /dev/null
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryListener.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * - Neither the name of the Git Development Community nor the
+ * names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.spearce.jgit.lib;
+
+/**
+ * A RepositoryListener gets notification about changes in refs or repository.
+ * <p>
+ * It currently does <em>not</em> get notification about which items are
+ * changed.
+ */
+public interface RepositoryListener {
+ /**
+ * Invoked when a ref changes
+ *
+ * @param e
+ * information about the changes.
+ */
+ void refsChanged(RefsChangedEvent e);
+
+ /**
+ * Invoked when the index changes
+ *
+ * @param e
+ * information about the changes.
+ */
+ void indexChanged(IndexChangedEvent e);
+
+}
--
1.5.6.2.220.g44701
^ permalink raw reply related
* Re: [PATCH 1/2] help.c: Add support for htmldir relative to git_exec_path()
From: Johannes Sixt @ 2008-07-11 9:02 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Junio C Hamano, Git Mailing List, Johannes Schindelin
In-Reply-To: <4668B2FF-2B2B-4221-8151-F0AEA681983C@zib.de>
Zitat von Steffen Prohaska <prohaska@zib.de>:
>
> On Jul 4, 2008, at 2:35 PM, Johannes Schindelin wrote:
>
> > On Fri, 4 Jul 2008, Junio C Hamano wrote:
> >
> >> Could you check if there are copy-and-pasted duplicated code you can
> >> factor out before continuing this direction?
> >
> > Note also that Hannes tried very hard to get rid of those ugly "#ifdef
> > __MINGW32__"s by declaring/overriding functions in git-compat-util.h.
> >
> > I think that is such a good practice that we should not stop here.
>
> I'll send three patches that address Junio's and Dscho's comments:
>
> [PATCH 1/3] Move code interpreting path relative to exec-dir to new
> function system_path()
> [PATCH 2/3] help.c: Add support for htmldir relative to
> git_exec_path()
> [PATCH 3/3] help (Windows): Display HTML in default browser using
> Windows' shell API
>
>
> Hannes,
> the patches I'll send probably conflict with your planned work on
> GIT_EXEC_PATH that has been discussed on the msysgit list. I think
> you could built on my series and modify system_path().
Thanks. I haven't done a lot in that direction, yet, so your patches will be
helpful.
But according to the conclusion of our recent discussion
http://thread.gmane.org/gmane.comp.version-control.msysgit/2633/focus=2669
I shall modify system_path() to construct paths relative to the git executable,
which is essentially Makefile's $(bindir), not git_exec_path().
-- Hannes
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox