Ticket #2685 (assigned defect)

Opened 5 years ago

Last modified 8 months ago

shortrev_len does not work

Reported by: xlyz at tiscali d ot it Assigned to: hvr (accepted)
Priority: normal Component: GitPlugin
Severity: normal Keywords:
Cc: lkraav, ronniemaor, shogsbro Trac Release: 0.12

Description

Trac-0.11b1 and gitplugin (3275). no matter how I set shortrev_len rev sha remain 40 caracter long

Attachments

pass_repo.patch (3.4 kB) - added by roadrunner on 08/17/09 10:46:45.
A small preparatory change (same patch as in #5351)
rev_len.patch (12.5 kB) - added by roadrunner on 08/17/09 10:47:55.
Add rev_len config option and shorten all displayed revisions to that length
r_rev.patch (0.8 kB) - added by roadrunner on 08/17/09 10:48:39.
Recognize r<rev> wiki syntax too
svn_mapping.patch (3.6 kB) - added by ronniemaor on 04/03/10 22:39:52.
patch for supporting existing svn wiki references
rev_mapping.py (1.8 kB) - added by ronniemaor on 04/09/10 13:10:24.
script for generating svn_mapping file for the svn_mapping patch
rev_len_0.12.patch (0.9 kB) - added by bash on 08/05/10 21:53:01.
Use Trac 0.12's display_rev feature to shorten SHAs in the UI (also includes the rXYZ linking patch)

Change History

03/05/08 01:47:48 changed by thatch

I took a glance at this too with 0.10, 0.11b1, and trunk (with the respective plugins from t-h) and it looks the same to me on a very simple git db (or whatever you call it). Adding some print statements seems to indicate that short_rev is only called for displaying the changeset page, but that might be be clouded by the cache.

03/21/09 20:46:21 changed by Robin

I'd like to use this feature too, but it doesn't work with GitPlugin trunk and Trac 0.11.3.

04/27/09 19:01:25 changed by deisner@gmail.com

Same here, doesn't work with GitPlugin and Trac 0.11.4.

05/18/09 09:42:07 changed by patrick232

same here

GitPlugin (the latest)
Trac 0.12multirepos-r8178
git 1.6.2.4

06/16/09 12:22:52 changed by anonymous

Same here. This is so annoying that it (a) clutters the code browser and I can't read the commit messages and (b) it keeps me switching from Redmine (which I would really like to do ;-) ).

(follow-ups: ↓ 7 ↓ 15 ) 08/17/09 10:44:50 changed by roadrunner

shortrev_len works as designed; however, there seems to be some confusion as to what it does: it configures the length of the shortened revision number displayed in things like the diff (column heads) and the annotated file view (revision for each line).

I'm attaching three patches, the second one of which does the main job of adding a new rev_len option which controls the length of all revisions displayed (except for those covered by shortrev). This also makes trac recognize shortened revs in the wiki syntax. The third patch adds support for recognizing the r<rev> wiki syntax too. The patches must be applied in the order I'm attaching them.

08/17/09 10:46:45 changed by roadrunner

  • attachment pass_repo.patch added.

A small preparatory change (same patch as in #5351)

08/17/09 10:47:55 changed by roadrunner

  • attachment rev_len.patch added.

Add rev_len config option and shorten all displayed revisions to that length

08/17/09 10:48:39 changed by roadrunner

  • attachment r_rev.patch added.

Recognize r<rev> wiki syntax too

(in reply to: ↑ 6 ) 08/26/09 22:17:25 changed by tomster

Replying to roadrunner:

I'm attaching three patches, the second one of which does the main job of adding a new rev_len option which controls the length of all revisions displayed (except for those covered by shortrev). This also makes trac recognize shortened revs in the wiki syntax. The third patch adds support for recognizing the r<rev> wiki syntax too. The patches must be applied in the order I'm attaching them.

any reason why these patches haven't been merged? i'm reluctant to patch my installation (it's enough dealing with the python2.4 compatibility patch...)

just asking...

03/02/10 23:51:18 changed by lkraav

  • cc set to lkraav.

cc-ing, looking to get this fixed too.

04/03/10 22:39:52 changed by ronniemaor

  • attachment svn_mapping.patch added.

patch for supporting existing svn wiki references

04/03/10 22:41:28 changed by ronniemaor

I'm working on migrating our company from svn to git. I applied the patches above, and they are a great improvement.

Since we're migrating and not starting a new project, we have quite a bit of history in tickets etc. that points to changesets using their svn revision number, and it would be a shame to lose that functionality after the conversion.

I'm attaching a patch that allows you to configure an svn revision mapping file that maps svn revisions to git revisions (easy to get it with git svn find-rev or going over the git log after importing from svn). The plugin then treats old svn wiki references as if they were pointing to the new git SHAs.

hope others find this useful and/or that you can include this patch too (I tried to keep to the coding conventions...)

04/03/10 22:46:28 changed by ronniemaor

  • cc changed from lkraav to lkraav, ronniemaor.

04/09/10 13:10:24 changed by ronniemaor

  • attachment rev_mapping.py added.

script for generating svn_mapping file for the svn_mapping patch

06/29/10 08:28:58 changed by lkraav

resolution of #T3533 probably helps this along for 0.12.

08/05/10 21:53:01 changed by bash

  • attachment rev_len_0.12.patch added.

Use Trac 0.12's display_rev feature to shorten SHAs in the UI (also includes the rXYZ linking patch)

(follow-up: ↓ 14 ) 08/05/10 21:55:36 changed by bash

For anyone who has upgraded to Trac 0.12, I've attached a patch that uses the new display_rev functionality from #T3533 to shorten SHAs. Rather than introducing a new variable, it just uses shortrev_len. The patch also includes the minor change to make parsing rXYZ as a link, but it's slightly buggy in multiple repository tracs.

10/15/10 23:58:48 changed by anonymous

  • cc changed from lkraav, ronniemaor to lkraav, ronniemaor, shogsbro.

(in reply to: ↑ 12 ) 10/16/10 20:41:37 changed by hvr

Replying to bash:

For anyone who has upgraded to Trac 0.12, I've attached a patch that uses the new display_rev functionality from #T3533 to shorten SHAs. Rather than introducing a new variable, it just uses shortrev_len. The patch also includes the minor change to make parsing rXYZ as a link, but it's slightly buggy in multiple repository tracs.

I've integrated and enhanced your suggestions in

3551f77861d14314771400ed2ee68c425d80e5b7 and 23afc8ee8908bf4ae0da38d78604d85b5736539e

N.b.: I do introduce a new separate config option for configuring the wiki syntax hex-string min-length, wiki_shortrev_len.

(in reply to: ↑ 6 ) 10/16/10 20:45:32 changed by hvr

Replying to roadrunner:

I'm attaching three patches, the second one of which does the main job of adding a new rev_len option which controls the length of all revisions displayed (except for those covered by shortrev).

I'm wondering whether we want to have two different displayed length, or if the implementation I just committed is good enough for everybody? :)

10/16/10 20:45:59 changed by hvr

  • release changed from 0.11 to 0.12.
  • status changed from new to assigned.

Add/Change #2685 (shortrev_len does not work)




Change Properties
Action