After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 720731 - Show file renames in diff stats
Show file renames in diff stats
Status: RESOLVED FIXED
Product: gitg
Classification: Applications
Component: gitg
git master
Other All
: Normal normal
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-19 10:46 UTC by Techlive Zheng
Modified: 2014-06-28 07:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Show file renames in diff stats (1.20 KB, patch)
2013-12-19 10:46 UTC, Techlive Zheng
none Details | Review
Screenshot of the diff rename (15.00 KB, image/png)
2013-12-19 10:50 UTC, Techlive Zheng
  Details
Show file renames in diff stats (1.19 KB, patch)
2013-12-25 03:42 UTC, Techlive Zheng
none Details | Review
Show file renames in diff stats (1.19 KB, patch)
2013-12-25 03:44 UTC, Techlive Zheng
none Details | Review

Description Techlive Zheng 2013-12-19 10:46:28 UTC
With patch https://bugzilla.gnome.org/show_bug.cgi?id=720127 to libgit2-glib,
we can show renames now.
Comment 1 Techlive Zheng 2013-12-19 10:46:30 UTC
Created attachment 264526 [details] [review]
Show file renames in diff stats
Comment 2 Techlive Zheng 2013-12-19 10:50:56 UTC
Created attachment 264527 [details]
Screenshot of the diff rename

We can see the changes between the renamed files too.
Comment 3 jessevdk@gmail.com 2013-12-19 12:44:47 UTC
Review of attachment 264526 [details] [review]:

::: libgitg/resources/diff-view-html-builder.js
@@ +114,3 @@
+	if (file.similarity > 0)
+	{
+		filepath = file.file.new.path + '(Previously: ' +file.file.old.path + ')';

Instead of "Previously" I think it might be better to do something like:

old path → new path
Comment 4 Techlive Zheng 2013-12-19 13:00:25 UTC
(In reply to comment #3)
> Review of attachment 264526 [details] [review]:
> 
> ::: libgitg/resources/diff-view-html-builder.js
> @@ +114,3 @@
> +    if (file.similarity > 0)
> +    {
> +        filepath = file.file.new.path + '(Previously: ' +file.file.old.path +
> ')';
> 
> Instead of "Previously" I think it might be better to do something like:
> 
> old path → new path

Actually, It was my first choice, but I thought it would be better to show the new file first, it is more clear that which file the diff below belongs to.
Comment 5 Techlive Zheng 2013-12-21 17:08:11 UTC
See branch wip/techlivezh/show-diff-renames
Comment 6 jessevdk@gmail.com 2013-12-23 09:26:41 UTC
Then what about

new path ← old path
Comment 7 Techlive Zheng 2013-12-23 09:30:51 UTC
(In reply to comment #6)
> Then what about
> 
> new path ← old path

Yeah, that'd be fine.
Comment 8 Techlive Zheng 2013-12-25 03:42:35 UTC
Created attachment 264861 [details] [review]
Show file renames in diff stats
Comment 9 Techlive Zheng 2013-12-25 03:44:27 UTC
Created attachment 264862 [details] [review]
Show file renames in diff stats
Comment 10 jessevdk@gmail.com 2014-06-28 07:03:21 UTC
Thanks! I've committed a slightly updated patch.