git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFH] WTF did we change in git-fsck recently?
@ 2007-04-21  0:30 Junio C Hamano
  2007-04-21  1:24 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-04-21  0:30 UTC (permalink / raw)
  To: Linus Torvalds, Nicolas Pitre; +Cc: git

I noticed that "git-fsck --full" from 'master' takes forever to
fsck the kernel repository (I left it running for 2 hours before
killing it), while the one from 'maint' (or 1.5.1.1 which is
installed on kernel.org) finishes within 2 or 3 minutes.  There
is some serious breakages there.

Rings a bell?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFH] WTF did we change in git-fsck recently?
  2007-04-21  0:30 [RFH] WTF did we change in git-fsck recently? Junio C Hamano
@ 2007-04-21  1:24 ` Linus Torvalds
  2007-04-21  1:30   ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2007-04-21  1:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nicolas Pitre, git



On Fri, 20 Apr 2007, Junio C Hamano wrote:
>
> I noticed that "git-fsck --full" from 'master' takes forever to
> fsck the kernel repository (I left it running for 2 hours before
> killing it), while the one from 'maint' (or 1.5.1.1 which is
> installed on kernel.org) finishes within 2 or 3 minutes.  There
> is some serious breakages there.

Hmm. Probably something broken in my "object decorator" thing then. 

Will check it out, I hadn't noticed myself.

		Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFH] WTF did we change in git-fsck recently?
  2007-04-21  1:24 ` Linus Torvalds
@ 2007-04-21  1:30   ` Linus Torvalds
  2007-04-21  2:17     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2007-04-21  1:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nicolas Pitre, git



On Fri, 20 Apr 2007, Linus Torvalds wrote:
> 
> Hmm. Probably something broken in my "object decorator" thing then. 

Duh.

When I did the object decorator thing, I made the "loop over the hash" 
function use the same logic for updating the hash, ie made them use

	if (++j >= size)
		j = 0;

for both the hash update for both "insert" and "lookup"

HOWEVER.

For some inexplicable reason I had an extraneous

	j++;

in the insert path (probably just from the fact that the old code there 
used 

	j++;
	if (j >= size)
		j = 0;

and when I made them use the same logic I just didn't remove the old 
extraneous line properly.

This fixes it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 decorate.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/decorate.c b/decorate.c
index 396b413..23f6b00 100644
--- a/decorate.c
+++ b/decorate.c
@@ -24,7 +24,6 @@ static void *insert_decoration(struct decoration *n, struct object *base, void *
 			hash[j].decoration = decoration;
 			return old;
 		}
-		j++;
 		if (++j >= size)
 			j = 0;
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFH] WTF did we change in git-fsck recently?
  2007-04-21  1:30   ` Linus Torvalds
@ 2007-04-21  2:17     ` Junio C Hamano
  2007-04-21 20:36       ` Automated bisect success story Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-04-21  2:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Nicolas Pitre, git

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Fri, 20 Apr 2007, Linus Torvalds wrote:
>> 
>> Hmm. Probably something broken in my "object decorator" thing then. 
>
> Duh.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Automated bisect success story
  2007-04-21  2:17     ` Junio C Hamano
@ 2007-04-21 20:36       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2007-04-21 20:36 UTC (permalink / raw)
  To: git; +Cc: Christian Couder

Learning from example by Steven Grimm, let me share a success
story.

Earlier I noticed that "fsck --full" from 'master' took forever
in linux-2.6 repository, but the one from 'maint' finished in 2
to 3 minutes.

We recently had a few enhancements by Christian Couder to
git-bisect, and this was a perfect opportunity to see how well
they worked:

(1) "git bisect start" now takes one bad and then one or more
    good commits, before suggesting the first revision to try.

Traditionally, immediately after you gave a bad and a good
commit, it did a single bisection and then a checkout.  This
avoids repeated bisect computation and checkout when you know
more than one good revisions before starting to bisect, and also
let you bootstrap with a single command (you could instead give
one good commit at a time and then finally a single bad commit
to avoid the waste).

Not only I know 'maint' is good, I also know that the tips of
"foreign projects" merged to git.git, that do not share any
codepath the fsck takes, are irrelevant to the problem.  So I
want to mark tips of commit ancestry I merged from git-gui
projects as good.  Hence:

	$ git bisect start master maint remotes/git-gui/master

Mnemonic.  Start takes a Bad before Goods, because B comes
before G.

(2) "git bisect run <script>" takes a script to judge the
    goodness of the given revision.  Because I know each round
    of test takes around 3 minutes, I wrote a little script to
    automate the process and gave it to "git bisect run":

	$ git bisect run ./+run-script

This ran for a while (I do not know how long it took -- I was
away from the machine and doing other things) and came back with
the "object decoration" one Linus has fixed yesterday with his
patch.

Here is the "+run-script".  I have git.git repository and
linux-2.6 repository next to each other.

-- >8 --
#!/bin/sh

# Build errors are not what I am interested in.
make git-fsck && cd ../linux-2.6 || exit 255

# We are checking if it stops in a reasonable amount of time, so
# let it run in the background...

../git.git/git-fsck --full >:log 2>&1 &

# ... and grab its process ID.
fsck=$!

# ... and then wait for sufficiently long.
sleep 240

# ... and then see if the process is still there.
if kill -0 $fsck
then
	# It is still running -- that is bad.
        # Three-kill is just a ritual and has no real meaning.
        # It is like "sync;sync;sync;reboot".
	kill $fsck; sleep 1; kill $fsck; sleep 1; kill $fsck;
	exit 1
else
	# It has already finished (the $fsck process was no more),
        # and we are happy.
	exit 0
fi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-21 20:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-21  0:30 [RFH] WTF did we change in git-fsck recently? Junio C Hamano
2007-04-21  1:24 ` Linus Torvalds
2007-04-21  1:30   ` Linus Torvalds
2007-04-21  2:17     ` Junio C Hamano
2007-04-21 20:36       ` Automated bisect success story Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).