Opened 7 years ago

Closed 7 years ago

#6554 closed enhancement (fixed)

Reported by: Owned by: kevin.mcconnell@… Herbert Valerio Riedel normal GitPlugin normal Tim Olsen, lkraav, stuge 0.12

Description

Attached is a patch to make the plugin work in 0.12, as mentioned in #1040. It updates the code to match the recent API changes in Trac:MultiRepos, and also makes abbreviated SHA-1's work in Trac:TracLinks.

You'll need to make the 0.12 branch first (svn cp 0.11 0.12) before applying this. I wasn't sure if there was a way to include that in the patch itself. It seems that Git has pushed all the SVN knowledge out of my brain :)

Also, it currently only works if cached_repository is disabled; not sure why at the moment. But the rest of it seems to be working.

Changed 7 years ago by kevin.mcconnell@…

changes for Trac 0.12

Changed 7 years ago by kevin.mcconnell@…

updated to include cached_repository support

comment:1 Changed 7 years ago by kevin.mcconnell@…

Added revised patch (gitplugin-0.12.v2.diff). It now also works when cached_repository=true.

comment:2 Changed 7 years ago by lkraav

is this the same thing as http://github.com/lentil/trac-git-plugin?

comment:4 Changed 7 years ago by Herbert Valerio Riedel

(In [7695]) created 0.12/ branch, tweaked setup.py, and applied patch by kevin.mcconnell@… (see #6554)

comment:5 Changed 7 years ago by irrshade

Does this patch still work with cached_repository enabled? I'm running a copy of Trac I checked out last night and it appears to have problems when cached_repository is on. (Seems related to a change made to Trac a few days ago to pad changeset numbers to ten digits).

I didn't have any luck figuring out a fix.

comment:6 Changed 7 years ago by irrshade

And of course I should have read the tickets on Trac before posting-- caching appears to have been fixed again for non-SVN repos in the latest HEAD for Trac.

comment:7 Changed 7 years ago by lkraav

re comment:6, for anyone else running into breakage, trac:#9089 -> trac:r9280 fixed git for me.

comment:8 follow-up:  9 Changed 7 years ago by andy.czerwonka@…

If I do the following:

easy_install http://trac-hacks.org/svn/gitplugin/0.12

I get a:

error: Unexpected HTML page found at http://trac-hacks.org/svn/gitplugin/0.12

comment:9 in reply to:  8 Changed 7 years ago by jhough

If I do the following:

easy_install http://trac-hacks.org/svn/gitplugin/0.12

I get a:

error: Unexpected HTML page found at http://trac-hacks.org/svn/gitplugin/0.12

Do you have a recent version of setuptools installed(>= 0.6c9)? There's a known problem in earlier versions that causes a similar error.

comment:10 Changed 7 years ago by stuge

Cc: stuge added → fixed new → closed

The plugin works beautifully for me in Trac 0.12, so I'm closing this.

comment:11 Changed 4 years ago by James Teh

Kevin, do you remember by any chance why you made GitCachedRepository.normalize_rev call self.repos.get_youngest_rev() rather than self.youngest_rev; i.e. doesn't use the cached metadata? I'm guessing performance would be better if the cache were used. I realise this was a long time ago, so you probably don't remember, but thought I'd ask in case you do. :)

comment:12 Changed 4 years ago by kevin.mcconnell@…

Sorry, I'm afraid my memory doesn't go back that far :) It might be that I just wasn't aware of a better way to do it. All I can suggest is that you try it the other way and see.

Sorry I couldn't be more help!

Modify Ticket

Change Properties