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 466607 - UI components are not serialized in the same order each time you hit 'save'
UI components are not serialized in the same order each time you hit 'save'
Status: RESOLVED DUPLICATE of bug 422823
Product: glade
Classification: Applications
Component: general
3.2.x
Other All
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-08-14 13:57 UTC by Zeeshan Ali
Modified: 2007-08-14 20:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Zeeshan Ali 2007-08-14 13:57:34 UTC
Please describe the problem:
UI is not serialized to same xml each time you hit 'save' and the SCM think (for a gook reason) that the glade file has local modification.

Steps to reproduce:
Just load and save a project xml with a table of labels and images, e.g:

http://git.codethink.co.uk/?p=gupnp-tools;a=blob_plain;f=src/gupnp-universal-cp.glade;hb=HEAD

Actual results:
the saved xml is not the same as the one loaded.

Expected results:
the saved xml should be exactly the same as the one loaded.

Does this happen every time?
Yes

Other information:
Comment 1 Tristan Van Berkom 2007-08-14 14:31:43 UTC
Glade only tries to save an xml that is an honest representation
of the objects and properties in a glade file.

Glade makes no guarantee about what order properties or objects
will saved in.



*** This bug has been marked as a duplicate of 422823 ***
Comment 2 Zeeshan Ali 2007-08-14 14:46:45 UTC
(In reply to comment #1)
> 
> Glade makes no guarantee about what order properties or objects
> will saved in.

   How come i didn't encounter this problem until i (actually debian testing) switched to glade 3? Moreover, how am i supposed to manage the glade file in an SCM?
Comment 3 Tristan Van Berkom 2007-08-14 14:53:43 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > 
> > Glade makes no guarantee about what order properties or objects
> > will saved in.
> 
>    How come i didn't encounter this problem until i (actually debian testing)
> switched to glade 3?

glade 2 is a completely different source base.

> Moreover, how am i supposed to manage the glade file in an
> SCM?

This is more of a sarcastic remark than a question, if it were
a question though, the answer would be just checkout/edit/commit/tag
as you would any other file.
Comment 4 Zeeshan Ali 2007-08-14 15:08:05 UTC
(In reply to comment #3)
> >    How come i didn't encounter this problem until i (actually debian testing)
> > switched to glade 3?
> 
> glade 2 is a completely different source base.

  I know that, you can re-write glade as many times as you people like but that shouldn't result in dropping good features that people are used to.
 
> > Moreover, how am i supposed to manage the glade file in an
> > SCM?
> 
> This is more of a sarcastic remark than a question, if it were
> a question though, the answer would be just checkout/edit/commit/tag
> as you would any other file.

  I am sorry if it sounded like that but it wasn't. There are two problems:

1. Each time i load the file and close it without actually making any changes, i'll have to revert it (just a waste of developer time).

2. Each time I make changes and would want to commit it, some unnecessary changes will also be accompanied with these changes and will make the diff hard to read. Thanks to git 1.5 that provides the way to avoid this but i'll have to make extra efforts and not everyone uses git or darcs.

Comment 5 Tristan Van Berkom 2007-08-14 15:14:57 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > >    How come i didn't encounter this problem until i (actually debian testing)
> > > switched to glade 3?
> > 
> > glade 2 is a completely different source base.
> 
>   I know that, you can re-write glade as many times as you people like but that
> shouldn't result in dropping good features that people are used to.

I suppose this was not a sarcastic remark either ?

> > > Moreover, how am i supposed to manage the glade file in an
> > > SCM?
> > 
> > This is more of a sarcastic remark than a question, if it were
> > a question though, the answer would be just checkout/edit/commit/tag
> > as you would any other file.
> 
>   I am sorry if it sounded like that but it wasn't. There are two problems:
> 
> 1. Each time i load the file and close it without actually making any changes,
> i'll have to revert it (just a waste of developer time).
> 
> 2. Each time I make changes and would want to commit it, some unnecessary
> changes will also be accompanied with these changes and will make the diff hard
> to read. Thanks to git 1.5 that provides the way to avoid this but i'll have to
> make extra efforts and not everyone uses git or darcs.
> 

Making glade files diff nicely right now is just not a priority.
Comment 6 Zeeshan Ali 2007-08-14 15:22:04 UTC
> >   I know that, you can re-write glade as many times as you people like but that
> > shouldn't result in dropping good features that people are used to.
> 
> I suppose this was not a sarcastic remark either ?
 
   It was a remark, alright but no sarcasm.
 
> Making glade files diff nicely right now is just not a priority.

  I can understand that but in previous comments from you, it sounded like you don't concider it a problem at all.

Comment 7 Tristan Van Berkom 2007-08-14 15:40:26 UTC
(In reply to comment #6)
[...]
> > Making glade files diff nicely right now is just not a priority.
> 
>   I can understand that but in previous comments from you, it sounded like you
> don't concider it a problem at all.
> 

Widgets will always be saved in the order in which they
are returned from the backend, in most cases this order
is dictated by gtk_container_get_children() (or some
varient of the same), for some cases (i.e. bug 364078)
it will be important for the backend to return widgets
in a specific order (in those cases real bugs result
from the ordering).

I really dont consider it a problem that glade files
arent diffable, as specially when weighed against the
complexity needed in the core to accomadate such a
low priority enhancement.

I really do consider it a waste of my time to go deeply 
in depth on this bug report and explain at length
our reasoning on this issue (I've spent upwards to an hour
of distraction by now, I could have been integrating 
the icon chooser dialog instead...) when I can simply say 
"not gonna happen", "sorry this feature is not a requirement for glade"
Comment 8 Thomas Vander Stichele 2007-08-14 19:50:23 UTC
Tristan, I think you are overstating the complexity needed to implement this.  For example, you could simply sort on name of widget, and inside widget on name of attribute.

I agree with Zeeshan that diffability is important, and this would definately be a reason for me not to move to glade-3.  After I change layouts (for example pixel spacings) in glade, I prefer to analyze my local diff like any other to make sure I didn't do anything stupid.

Zeeshan, why don't you just provide a patch that does an ordering ? I'm sure it would get accepted if done right.
Comment 9 Tristan Van Berkom 2007-08-14 20:21:38 UTC
Sure, diffability was never a feature that we intended to implement, if it
can be done without being overly complex and you feel like its worth
your energy to address it, be my guest.

if you want to continue this dialog constructively, its bug 422823.