List for cgit developers and users
 help / color / mirror / Atom feed
* git gc and idle times
@ 2011-05-11 14:06 thomas.moschny
  2011-05-11 14:47 ` cgit
  2011-05-31  8:22 ` mailings
  0 siblings, 2 replies; 5+ messages in thread
From: thomas.moschny @ 2011-05-11 14:06 UTC (permalink / raw)


Hi,

we are using cgit 0.9 successfully on a bunch of repositories. Nice
tool!

One question however: After running git-gc on some of the repositories,
the overview page of cgit misses idle times for those. The idle time is
back after pushing a commit. Is there something that needs to be
adjusted/fixed manually after running git-gc? Or is it a bug of cgit?

Thanks,
-- 
Thomas Moschny  <thomas.moschny at gmx.de>




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

* git gc and idle times
  2011-05-11 14:06 git gc and idle times thomas.moschny
@ 2011-05-11 14:47 ` cgit
  2011-05-13 17:01   ` mailings
  2011-05-31  8:22 ` mailings
  1 sibling, 1 reply; 5+ messages in thread
From: cgit @ 2011-05-11 14:47 UTC (permalink / raw)


On Wed, May 11, 2011 at 04:06:28PM +0200, Thomas Moschny wrote:
> Hi,
> 
> we are using cgit 0.9 successfully on a bunch of repositories. Nice
> tool!
> 
> One question however: After running git-gc on some of the repositories,
> the overview page of cgit misses idle times for those. The idle time is
> back after pushing a commit. Is there something that needs to be
> adjusted/fixed manually after running git-gc? Or is it a bug of cgit?

cgit uses the mtime of the file containing the default branch's HEAD ref
to guess the idle time if there's no agefile. If you pack heads and tags
there won't be such a file anymore, resulting in no idle time being
displayed.

You could try to set "gc.packrefs" to "notbare" to prevent the garbage
collector from packing refs as a workaround.




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

* git gc and idle times
  2011-05-11 14:47 ` cgit
@ 2011-05-13 17:01   ` mailings
  0 siblings, 0 replies; 5+ messages in thread
From: mailings @ 2011-05-13 17:01 UTC (permalink / raw)


On 05/11/2011 04:47 PM, Lukas Fleischer wrote:
> On Wed, May 11, 2011 at 04:06:28PM +0200, Thomas Moschny wrote:
>> Hi,
>>
>> we are using cgit 0.9 successfully on a bunch of repositories. Nice
>> tool!
>>
>> One question however: After running git-gc on some of the repositories,
>> the overview page of cgit misses idle times for those. The idle time is
>> back after pushing a commit. Is there something that needs to be
>> adjusted/fixed manually after running git-gc? Or is it a bug of cgit?
> 
> cgit uses the mtime of the file containing the default branch's HEAD ref
> to guess the idle time if there's no agefile. If you pack heads and tags
> there won't be such a file anymore, resulting in no idle time being
> displayed.
> 
> You could try to set "gc.packrefs" to "notbare" to prevent the garbage
> collector from packing refs as a workaround.
> 

I have this too.

When repos are repacked then some refs can end up in packed-refs,
including the ref for the default branch.

I think cgit should add one more fallback to look for packed-refs before
giving up.

I'll be submitting a patch later to this effect.

grtz

-- 
Ferry Huberts




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

* git gc and idle times
  2011-05-11 14:06 git gc and idle times thomas.moschny
  2011-05-11 14:47 ` cgit
@ 2011-05-31  8:22 ` mailings
  2011-06-01 14:34   ` thomas.moschny
  1 sibling, 1 reply; 5+ messages in thread
From: mailings @ 2011-05-31  8:22 UTC (permalink / raw)


On 05/11/2011 04:06 PM, Thomas Moschny wrote:
> Hi,
> 
> we are using cgit 0.9 successfully on a bunch of repositories. Nice
> tool!
> 
> One question however: After running git-gc on some of the repositories,
> the overview page of cgit misses idle times for those. The idle time is
> back after pushing a commit. Is there something that needs to be
> adjusted/fixed manually after running git-gc? Or is it a bug of cgit?
> 

patch is in master: 21e0e0bfac660072a4518f91f59d5c4bf6e764b5

grtz

-- 
Ferry Huberts




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

* git gc and idle times
  2011-05-31  8:22 ` mailings
@ 2011-06-01 14:34   ` thomas.moschny
  0 siblings, 0 replies; 5+ messages in thread
From: thomas.moschny @ 2011-06-01 14:34 UTC (permalink / raw)



Ferry Huberts <mailings at hupie.com>:
> On 05/11/2011 04:06 PM, Thomas Moschny wrote:
> > One question however: After running git-gc on some of the
> > repositories, the overview page of cgit misses idle times for
> > those. The idle time is back after pushing a commit. Is there
> > something that needs to be adjusted/fixed manually after running
> > git-gc? Or is it a bug of cgit?
> 
> patch is in master: 21e0e0bfac660072a4518f91f59d5c4bf6e764b5

Thanks!

Meanwhile, I added this code to each post-update hook

git for-each-ref --format='%(committerdate)' \
  --sort=-committerdate --count=1 \
  > $GIT_DIR/info/web/last-modified

Works fine.

-- 
Thomas Moschny  <thomas.moschny at gmx.de>




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

end of thread, other threads:[~2011-06-01 14:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 14:06 git gc and idle times thomas.moschny
2011-05-11 14:47 ` cgit
2011-05-13 17:01   ` mailings
2011-05-31  8:22 ` mailings
2011-06-01 14:34   ` thomas.moschny

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).