Opened 11 years ago

Closed 4 years ago

shortrev_len does not work

Reported by: Owned by: xlyz@… Herbert Valerio Riedel normal GitPlugin normal lkraav, Ronnie Maor, Sigurd Hogsbro 0.12

Description

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

comment:1 Changed 11 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 10 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 10 years ago by deisner@…

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

comment:4 Changed 10 years ago by patrick

same here

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

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

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

Changed 10 years ago by roadrunner

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

Changed 10 years ago by roadrunner

Recognize r<rev> wiki syntax too

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

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

comment:8 Changed 9 years ago by lkraav

cc-ing, looking to get this fixed too.

Changed 9 years ago by Ronnie Maor

patch for supporting existing svn wiki references

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

Changed 9 years ago by Ronnie Maor

script for generating svn_mapping file for the svn_mapping patch

comment:11 Changed 9 years ago by lkraav

resolution of #T3533 probably helps this along for 0.12.

Changed 9 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:  14 Changed 9 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:14 in reply to:  12 Changed 9 years ago by Herbert Valerio Riedel

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

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

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

Status: new → assigned 0.11 → 0.12

comment:17 Changed 4 years ago by Ryan J Ollos

Resolution: → wontfix assigned → closed

Modify Ticket

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