Feature #11152

Linking commit comment and time spent comment

Added by Jonathan Rajotte over 10 years ago. Updated over 3 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Jonathan Rajotte% Done:

0%

Category:Time tracking
Target version:-
Resolution:

Description

Hi,

We are currently trying to use redmine for educational purpose at Polytechnique of Montréal Computer and Software engineering department.

Remine 1.4.2 is almost the perfect fit for our needs.

Redmine will be used by 20-40 team of 4-6 students for 4 months projects.

No need to tell that with students, if you want them to use something it got to be simple and powerfull( just like redmine !)
So each team will have to provide a weekly time sheet(no problem so far).

Using commit time tracking with git is very usefull. Except for one little thing, the comment associated with the time log is

Appliqué par commit test2|commit:c609cd1786d5d47d558efa5084113fadc98984f4

which is not very informative about what have been done,expecially for the instructors!

Sure the students could go on site and change the comment associated with the log but it's like doing the same job twice and you can't expect that much with students...

So
This is the syntax i'm currently using for commit:

 refs #5 @0h30min test for function abcdef() added but need verification

So the output in the time entrie we would like to see is (see result.png)

and at the same time why can't we add comment to time report?

Is there anyway to achieve this ?

Thank you

Jonathan Rajotte

result.PNG - result (32.5 KB) Jonathan Rajotte, 2012-06-13 21:05

magic_links.png (3.1 KB) Jean-Philippe Lang, 2012-06-14 13:49

patch_time_log_comment.diff Magnifier (2.55 KB) Jonathan Rajotte, 2012-07-12 19:33

time_log.PNG - time_entry (10.6 KB) Jonathan Rajotte, 2012-07-12 19:33

corrected_time_log_comment.patch Magnifier (2.47 KB) Jonathan Rajotte, 2012-08-14 20:59


Related issues

Related to Redmine - Feature #9804: Automatic activity of spent time logging from commit mess... New
Duplicated by Redmine - Defect #11484: Problem with "Applied in changeset" comment Closed

History

#1 Updated by Jean-Philippe Lang over 10 years ago

  • File magic_links.png added
  • Subject changed from Linking commit comment and time spent comment (Git) to Linking commit comment and time spent comment

I'd prefer to enable "magic" Redmine links in time entry comments rather than appending the commit message to it. This way the commit:... would be turned into a clickable link to the commit (with the commit message visible in the link title):

What do you think?

#2 Updated by Jonathan Rajotte over 10 years ago

Well, it's an improvment from what we got.

The thing is that we want to use the time entry as a weekly time sheet report. We want to know what have been done each time they commit time. This would be used as a tool for instructor for an easy follow-up. I hardly see an instructor go over maybe forty commit and time logging( for 10+ teams) with this solution.

Maybe one solution would be adding a comment syntax for commit. Something like this:

refs #3 @0h00min & insert comment to link here & 

add if no comment is present just go with the "magic" link.

This could be a good solution i think.

I've seen patch for % ratio => #10767 but nothing for comment.

I know this represent some work but we are very greatfull for everything.

#3 Updated by Jonathan Rajotte over 10 years ago

Any update about this ?

#4 Updated by Mischa The Evil over 10 years ago

Jean-Philippe Lang wrote:

I'd prefer to enable "magic" Redmine links in time entry comments rather than appending the commit message to it. This way the commit:... would be turned into a clickable link to the commit (with the commit message visible in the link title):

What do you think?

I think this looks like a partial revival of issue #202 for about the "textilization" of the Timelog-entry comments. I'd say it would be an improvement to have these magic Redmine links enabled in the time-reports, especially now #4155 (superceding #1518 which also included %-done ratio support [like now aditionally requested in #10767]) is implemented within the core.

Though, I don't think this change will fulfill the request in this issue completely...

#5 Updated by Jonathan Rajotte over 10 years ago

Well, I've put some time on this and finally come with a solution changing changeset.rb. With a little help from the solution provided in #10767.

I have modified TIMELOG_RE by swapping (m|min) to (min|m) because it was causing pattern recognition problem when using this syntax

refs #3 @10h10min

On it's orignal form using the regex would find this pattern despite the min keyword

refs #3 @10h10m

The rest is only regex manipulation and adding an argument to log_time function + a little verification for nil argument

The new syntax:

refs #3 @10h10min & Insert comment for time log entry here &  normal comment here

The &***& field is only considered if @*** is present

Multiples refs is functional as normal

The output:
commit comment:

refs #3 @10h10min & Insert comment for time log entry here &  normal comments here

output:

if no &**& is present the old comment form is used

what do you think ?

#6 Updated by Etienne Massip over 10 years ago

I don't get it.

Why not simply textilize the content as Jean-Philippe suggested and replace the "Appliqué par xxxx" in the time log comment by the committed comment (if present)?

#7 Updated by Jonathan Rajotte over 10 years ago

It would be very nice to get textilize content as well but the reason why I introduced a new syntax is simply for practical reason.

Ex. I wish to commit to my svn with this comment:

refs #4 @10h10min & function log_time,function log_comment_svn, refactoring the regexp &  still having issue with pattern generation

On my time entry, I want what have been done, not some comment for the rest of the team or whatever (remember we use this as an educational tool...)

I think the distinction between Time comments and general comments is necessery.

I don't know if the main branch need this but I think it easier for anybody who needs to check hours spent to have betters descriptions of what have been done. Sure dev could commit then update manually time logs but I found this really "archaic".

#8 Updated by Etienne Massip over 10 years ago

Jonathan Rajotte wrote:

I don't know if the main branch need this but I think it easier for anybody who needs to check hours spent to have betters descriptions of what have been done. Sure dev could commit then update manually time logs but I found this really "archaic".

I'm not sure about having general comments in vcs commits, this is not their place, only code related comments.

What you need is a plugin for your specific case IMHO, but I agree that "Applied with" comments might be replaced by commit comment in time tracking or they are hardly understandable.

#9 Updated by Jonathan Rajotte over 10 years ago

Etienne Massip wrote:

I'm not sure about having general comments in vcs commits, this is not their place, only code related comments.

When I was talking about generals comments is was thinking code related comments with no relation to time logging.

Etienne Massip wrote:

[..] but I agree that "Applied with" comments might be replaced by commit comment in time tracking or they are hardly understandable.

This was the initial plan but I added syntax to separate time comments from general code comments. One or the other , as long as I can associate time and comment it's ok .

#10 Updated by Ania K over 10 years ago

Why not simply textilize the content as Jean-Philippe suggested and replace the "Appliqué par xxxx" in the time log comment by the committed comment (if present)?

I agree. It would be great to have this option by default in redmine. Right now this comments (Appliqué par commit) are not useful at all.

#11 Updated by Ania K over 10 years ago

  • Assignee set to Jonathan Rajotte

what do you think ?

Jonathan Rajotte - as I don't know Ruby, could I ask you a favour?

Could you make similar patch to the one you made but with "general" comment entered to time log entry?

I guess it is pretty similar to the change you made and would be really helpful for me :)

Thanks in advance :)

Ania

#12 Updated by Jonathan Rajotte over 10 years ago

  • Assignee deleted (Jonathan Rajotte)

I'm currently on a full-time project for the next 2 days. I'll do it as soon as possible. no problem

#13 Updated by Jonathan Rajotte over 10 years ago

  • Assignee set to Jonathan Rajotte

#14 Updated by Ania K over 10 years ago

Jonathan Rajotte wrote:

I'm currently on a full-time project for the next 2 days. I'll do it as soon as possible. no problem

Thanks a lot :) It's not that urgent but would be great to have this comments working without double entering it in "& &" format.

We want to use this view as weekly time sheet report as well but we don't have two types of comments :)

#15 Updated by Jonathan Rajotte over 10 years ago

The previous patch did not support issue linking, I forgot 2 parentheses.

#16 Updated by Andreas Krummsdorf about 7 years ago

Hi everone,

was is the current status of this request? So far it seems like Jonathan wrote a patch to cover his use case. Besides this, was is the official solution. I guess that i have the same problem with the comment in the time tracking entry.

I think it would be really useful if the commit message is used as comment in the time tracking entry. Because often there are reports generated for the time spend in a project and it would nice if the time tracking entries would include some meaningful comments. Because "Angewendet in Changeset commit:demo|19900296834faf5a5d434865cf04b55a733f04e7." is not very helpful. But it can also be additionally included if needed.

By the way, the last part of the actual comments seems like redmine syntax, but it is not formatted or linked. It is just plain text within the comment.

Greetings
Andreas

#17 Updated by Toshi MARUYAMA about 7 years ago

  • Related to Feature #9804: Automatic activity of spent time logging from commit messages added

#18 Updated by Markus Boremski over 4 years ago

Hey,
are there any news on this one here?
I also would be glad to have the possibility to "read" in the comments the commit-message.

I understand that there has been a discussion about the best way hot to do it.
Maybe for the start it would help to have the commit-message in the time-tracking-comment.

Would be glad to see something going on here.. :-)

#19 Updated by Benedikt Breinbauer over 3 years ago

We would need this as well. Without showing the git commit message instead of the commit hash this feature is not very useful.

Also available in: Atom PDF