Diffs could be better

Bug #198728 reported by Jonathan Lange
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned
Breezy
Triaged
Wishlist
Unassigned

Bug Description

I just got a diff a lot like this:

> === modified file 'foo.py'
> --- foo.py 2007-12-21 09:52:42 +0000
> + foo.py 2008-03-05 12:10:43 +0000
> @@ -13,7 +13,8 @@
>
> class IFoo(Interface):
>
> - bar = Attribute("The bar.")
> + baz = Attribute("The qux baz.")
> + bar = Attribute("The qux bar.")
> frob = Attribute("The frob name.")
>
> name = Attribute("The frob name as text.")

It would be nicer as:

> === modified file 'foo.py'
> --- foo.py 2007-12-21 09:52:42 +0000
> + foo.py 2008-03-05 12:10:43 +0000
> @@ -13,7 +13,8 @@
>
> class IFoo(Interface):
>
> + baz = Attribute("The qux baz.")
> - bar = Attribute("The bar.")
> + bar = Attribute("The qux bar.")
> frob = Attribute("The frob name.")
>
> name = Attribute("The frob name as text.")

Rob told me to file this :)

Tags: diff
Revision history for this message
Jignesh Borad (jigneshborad) wrote :

I think bazzar used diff to do this. For example, if you have two files a1.txt and a2.txt as below.

a1.txt
=====
bar = Attribute("The bar.")
frob = Attribute("The frob name.")

name = Attribute("The frob name as text.")
=====

a2.txt
=====
baz = Attribute("The qux baz.")
bar = Attribute("The qux bar.")
frob = Attribute("The frob name.")

name = Attribute("The frob name as text.")
=====

Now check following commands

diff -u b.txt a.txt
==================================
--- b.txt 2008-11-17 16:08:14.000000000 -0600
+++ a.txt 2008-11-17 16:09:05.000000000 -0600
@@ -1,4 +1,5 @@
-bar = Attribute("The bar.")
+baz = Attribute("The qux baz.")
+bar = Attribute("The qux bar.")
 frob = Attribute("The frob name.")

 name = Attribute("The frob name as text.")
==================================

So, we need to find a package for diff utility and may be change this bug for that package if you feel like.

Revision history for this message
Jignesh Borad (jigneshborad) wrote :

in above explanation, please replace the last diff command with below.

diff -u a1.txt a2.txt
==================================
--- a1.txt 2008-11-17 16:08:14.000000000 -0600
+++ a2.txt 2008-11-17 16:09:05.000000000 -0600
@@ -1,4 +1,5 @@
-bar = Attribute("The bar.")
+baz = Attribute("The qux baz.")
+bar = Attribute("The qux bar.")
 frob = Attribute("The frob name.")

 name = Attribute("The frob name as text.")
==================================

Revision history for this message
John A Meinel (jameinel) wrote :

Displaying it as
- one line
+ another line
+ modified one line

Is the standard way to do unified diffs. I think it starts to get into the realm of AI to figure out which lines really should be grouped together and which ones shouldn't.

There are certainly times when I've wished things could be grouped differently, but I've had that with every tool I've tried. (vimdiff, diff, kdiff3)

Revision history for this message
Jignesh Borad (jigneshborad) wrote :

I think this qualifies for the brainstorming forum rather than considering as a bug. Makring as incomplete so that we can mark as invalid in the future.

Changed in bzr:
status: New → Incomplete
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 198728] Re: Diffs could be better

On Thu, 2008-11-20 at 04:34 +0000, Jignesh Borad wrote:
> I think this qualifies for the brainstorming forum rather than
> considering as a bug. Makring as incomplete so that we can mark as
> invalid in the future.

????
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Jignesh Borad (jigneshborad) wrote :

I meant the following forum for this.
http://brainstorm.ubuntu.com/

Revision history for this message
Robert Collins (lifeless) wrote :

On Thu, 2008-11-20 at 13:35 +0000, Jignesh Borad wrote:
> I meant the following forum for this.
> http://brainstorm.ubuntu.com/

Launchpad hosts many more projects than just Ubuntu; I appreciate that
you mean well - but for projects that are not Ubuntu itself - like bzr,
which is a VCS system which Ubuntu use, but is also used on many other
projects - the Ubuntu brainstorm isn't very relevant.

There is no 'diff command' to replace, as this bug is talking about
'bzr', not 'gnu diff'. It is also most definitely a bug - it is
something that can be better, and it is not incomplete (we have all the
data from the user that we need). Whether we can do something about or
not is a different matter, but closing it as invalid would be, well,
invalid.

Finally, if you want to help the bzr project with bug triage, please
read our bug guidelines on bazaar-vcs.org, and probably discuss the
first few you want to change on #bzr, or the mailing list.

Cheers,
Rob

 status confirmed
 importance wishlist

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Changed in bzr:
importance: Undecided → Wishlist
status: Incomplete → Confirmed
Revision history for this message
Jignesh Borad (jigneshborad) wrote :

Sure. Thanks for your help.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Wishlist
tags: added: diff
removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.