Modify

Opened 15 years ago

Closed 8 years ago

Last modified 7 weeks ago

#2685 closed defect (wontfix)

shortrev_len does not work

Reported by: xlyz@… Owned by: Herbert Valerio Riedel
Priority: normal Component: GitPlugin
Severity: normal Keywords:
Cc: lkraav, Ronnie Maor, Sigurd Hogsbro 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 14 years ago.
A small preparatory change (same patch as in #5351)
rev_len.patch (12.5 KB) - added by roadrunner 14 years ago.
Add rev_len config option and shorten all displayed revisions to that length
r_rev.patch (850 bytes) - added by roadrunner 14 years ago.
Recognize r<rev> wiki syntax too
svn_mapping.patch (3.6 KB) - added by Ronnie Maor 13 years ago.
patch for supporting existing svn wiki references
rev_mapping.py (1.8 KB) - added by Ronnie Maor 13 years ago.
script for generating svn_mapping file for the svn_mapping patch
rev_len_0.12.patch (949 bytes) - added by bash 13 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 (23)

comment:1 Changed 15 years ago by Tim Hatch

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 14 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 14 years ago by deisner@…

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

comment:4 Changed 14 years ago by patrick

same here

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

comment:5 Changed 14 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 Changed 14 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 14 years ago by roadrunner

Attachment: pass_repo.patch added

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

Changed 14 years ago by roadrunner

Attachment: rev_len.patch added

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

Changed 14 years ago by roadrunner

Attachment: r_rev.patch added

Recognize r<rev> wiki syntax too

comment:7 in reply to:  6 Changed 14 years ago by Tom Lazar

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 13 years ago by lkraav

Cc: lkraav added; anonymous removed

cc-ing, looking to get this fixed too.

Changed 13 years ago by Ronnie Maor

Attachment: svn_mapping.patch added

patch for supporting existing svn wiki references

comment:9 Changed 13 years ago by Ronnie Maor

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 13 years ago by Ronnie Maor

Cc: Ronnie Maor added

Changed 13 years ago by Ronnie Maor

Attachment: rev_mapping.py added

script for generating svn_mapping file for the svn_mapping patch

comment:11 Changed 13 years ago by lkraav

resolution of #T3533 probably helps this along for 0.12.

Changed 13 years ago 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)

comment:12 Changed 13 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 13 years ago by anonymous

Cc: Sigurd Hogsbro added

comment:14 in reply to:  12 Changed 13 years ago by Herbert Valerio Riedel

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 13 years ago by Herbert Valerio Riedel

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 13 years ago by Herbert Valerio Riedel

Status: newassigned
Trac Release: 0.110.12

comment:17 Changed 8 years ago by Ryan J Ollos

Resolution: wontfix
Status: assignedclosed

GitPlugin is deprecated. Please upgrade to Trac 1.0 and use TracGit.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Herbert Valerio Riedel.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.