Modify

Opened 7 years ago

Last modified 2 years ago

#2685 assigned defect

shortrev_len does not work

Reported by: xlyz@… Owned by: hvr
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 (6)

pass_repo.patch (3.4 KB) - added by roadrunner 5 years ago.
A small preparatory change (same patch as in #5351)
rev_len.patch (12.5 KB) - added by roadrunner 5 years ago.
Add rev_len config option and shorten all displayed revisions to that length
r_rev.patch (850 bytes) - added by roadrunner 5 years ago.
Recognize r<rev> wiki syntax too
svn_mapping.patch (3.6 KB) - added by ronniemaor 5 years ago.
patch for supporting existing svn wiki references
rev_mapping.py (1.8 KB) - added by ronniemaor 5 years ago.
script for generating svn_mapping file for the svn_mapping patch
rev_len_0.12.patch (949 bytes) - added by bash 4 years ago.
Use Trac 0.12's display_rev feature to shorten SHAs in the UI (also includes the rXYZ linking patch)

Download all attachments as: .zip

Change History (22)

comment:1 Changed 7 years ago 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.

comment:2 Changed 6 years ago by Robin

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

comment:3 Changed 6 years ago by deisner@…

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

comment:4 Changed 6 years ago by patrick232

same here

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

comment:5 Changed 6 years ago 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 ;-) ).

comment:6 follow-ups: Changed 5 years ago 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.

Changed 5 years ago by roadrunner

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

Changed 5 years ago by roadrunner

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

Changed 5 years ago by roadrunner

Recognize r<rev> wiki syntax too

comment:7 in reply to: ↑ 6 Changed 5 years ago 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...

comment:8 Changed 5 years ago by lkraav

  • Cc lkraav added; anonymous removed

cc-ing, looking to get this fixed too.

Changed 5 years ago by ronniemaor

patch for supporting existing svn wiki references

comment:9 Changed 5 years ago 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...)

comment:10 Changed 5 years ago by ronniemaor

  • Cc ronniemaor added

Changed 5 years ago by ronniemaor

script for generating svn_mapping file for the svn_mapping patch

comment:11 Changed 4 years ago by lkraav

resolution of #T3533 probably helps this along for 0.12.

Changed 4 years ago by bash

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

comment:12 follow-up: Changed 4 years ago 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.

comment:13 Changed 4 years ago by anonymous

  • Cc shogsbro added

comment:14 in reply to: ↑ 12 Changed 4 years ago 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.

comment:15 in reply to: ↑ 6 Changed 4 years ago 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? :)

comment:16 Changed 4 years ago by hvr

  • Status changed from new to assigned
  • Trac Release changed from 0.11 to 0.12

Add Comment

Modify Ticket

Action
as assigned The owner will remain hvr.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.