random changing of entries in config.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

random changing of entries in config.xml

bwestrich
I'm noticing that for most of my job config.xml files, the Perforce
plugin related entries seem to randomly change their ordering. This is
a bit of a nuisance since I keep this under source control, and this
change in ordering messes up my diffs between different versions of
the files.

I'm guessing this is related to a call to:

build.getParent().save();

The plugin needs this because it has some "one time use variables"
(e.g. the "force sync" variable does a forced get on the subsequent
build).  Because other plugins may not be doing this, they may not be
doing a save as often, so may not notice this behavior.

I recall Kohsuke weighing in a while back that one should only store
config info in the SCM object, not one time use info. Notwithstanding
this good point, I'm wondering why these xml file entries get
reordered. It would be nice if they could always store in the same
order.

Not a big deal, just curious......

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: random changing of entries in config.xml

Kohsuke Kawaguchi
Administrator
Brian Westrich wrote:

> I'm noticing that for most of my job config.xml files, the Perforce
> plugin related entries seem to randomly change their ordering. This is
> a bit of a nuisance since I keep this under source control, and this
> change in ordering messes up my diffs between different versions of
> the files.
>
> I'm guessing this is related to a call to:
>
> build.getParent().save();
>
> The plugin needs this because it has some "one time use variables"
> (e.g. the "force sync" variable does a forced get on the subsequent
> build).  Because other plugins may not be doing this, they may not be
> doing a save as often, so may not notice this behavior.
>
> I recall Kohsuke weighing in a while back that one should only store
> config info in the SCM object, not one time use info. Notwithstanding
> this good point, I'm wondering why these xml file entries get
> reordered. It would be nice if they could always store in the same
> order.
>
> Not a big deal, just curious......
What is the part that changes the order? Any chance it corresponds to an
orderless collection in your object or something?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: random changing of entries in config.xml

bwestrich
The entries that change order are fields on the class PerforceSCM
(which extends SCM). Is it valid to assume these should always be
stored in the same order?


On Dec 4, 2007 12:43 AM, Kohsuke Kawaguchi <[hidden email]> wrote:

>
> Brian Westrich wrote:
> > I'm noticing that for most of my job config.xml files, the Perforce
> > plugin related entries seem to randomly change their ordering. This is
> > a bit of a nuisance since I keep this under source control, and this
> > change in ordering messes up my diffs between different versions of
> > the files.
> >
> > I'm guessing this is related to a call to:
> >
> > build.getParent().save();
> >
> > The plugin needs this because it has some "one time use variables"
> > (e.g. the "force sync" variable does a forced get on the subsequent
> > build).  Because other plugins may not be doing this, they may not be
> > doing a save as often, so may not notice this behavior.
> >
> > I recall Kohsuke weighing in a while back that one should only store
> > config info in the SCM object, not one time use info. Notwithstanding
> > this good point, I'm wondering why these xml file entries get
> > reordered. It would be nice if they could always store in the same
> > order.
> >
> > Not a big deal, just curious......
>
> What is the part that changes the order? Any chance it corresponds to an
> orderless collection in your object or something?
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: random changing of entries in config.xml

Kohsuke Kawaguchi
Administrator
I thought so.

I know that Sun's Javac put fields in the class file in the order they
appear in the source file, and I know Sun's JVM return them in the
same order when you get it through reflection.

Hmm, but maybe XStream is messing with the order?

Is Perforce the only thing you noticed where the order seemingly
randomly change?

2007/12/4, Brian Westrich <[hidden email]>:

> The entries that change order are fields on the class PerforceSCM
> (which extends SCM). Is it valid to assume these should always be
> stored in the same order?
>
>
> On Dec 4, 2007 12:43 AM, Kohsuke Kawaguchi <[hidden email]> wrote:
> >
> > Brian Westrich wrote:
> > > I'm noticing that for most of my job config.xml files, the Perforce
> > > plugin related entries seem to randomly change their ordering. This is
> > > a bit of a nuisance since I keep this under source control, and this
> > > change in ordering messes up my diffs between different versions of
> > > the files.
> > >
> > > I'm guessing this is related to a call to:
> > >
> > > build.getParent().save();
> > >
> > > The plugin needs this because it has some "one time use variables"
> > > (e.g. the "force sync" variable does a forced get on the subsequent
> > > build).  Because other plugins may not be doing this, they may not be
> > > doing a save as often, so may not notice this behavior.
> > >
> > > I recall Kohsuke weighing in a while back that one should only store
> > > config info in the SCM object, not one time use info. Notwithstanding
> > > this good point, I'm wondering why these xml file entries get
> > > reordered. It would be nice if they could always store in the same
> > > order.
> > >
> > > Not a big deal, just curious......
> >
> > What is the part that changes the order? Any chance it corresponds to an
> > orderless collection in your object or something?
> >
> > --
> > Kohsuke Kawaguchi
> > Sun Microsystems                   [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: random changing of entries in config.xml

bwestrich
> Is Perforce the only thing you noticed where the order seemingly
> randomly change?

So far, yes. If I happen across something non-Perforce related that's
changing, I'll let you know.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]