Re: [Lazarus] Package and project file format

2018-03-04 Thread Michael Van Canneyt via Lazarus



On Sat, 3 Mar 2018, Denis Kozlov via Lazarus wrote:

+1 for getting rid of unit count and numeric tag suffixes from XML 
project/package files. They always create trouble for version control.


That was my point.



-1 for switching to JSON. Seems radical and unjustified, in my opinion.


Radical ? Absolutely. Unjustified ? A matter of opinion... JSON has many
advantages over XML.

Note that I didn't ask for that, it was just a remark on comments by someone
else...

If the counts are removed, my immediate goal (less conflicts) is reached.

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread Denis Kozlov via Lazarus
+1 for getting rid of unit count and numeric tag suffixes from XML 
project/package files. They always create trouble for version control.


-1 for switching to JSON. Seems radical and unjustified, in my opinion.

Denis


On 03/03/2018 10:15, Michael Van Canneyt via Lazarus wrote:


Hello,

The package .lpk andproject .lpi file use the following format :

    
  
    
    
    
  
  
    
    
    
    
    
  


And similarly
 
  
    
  
  
    
    
  


Is it possible to get rid of the counts ?

Reason: if 2 people add files to a package/project, it always creates
conflicts when updating from the VCS. And if you're in bad luck, you 
need to change a lot of items.


On the other hand, if you do
 
  
  
    
  

The chance of conflicts becomes less, and the resolution easier.

Michael.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread Lubos Pintes via Lazarus

Hi,
+1 for this. And really it looks stupid to me to have a different tag 
for every item like Item1 or Unit1.

Dňa 03.03.2018 o 11:15 Michael Van Canneyt via Lazarus napísal(a):


Hello,

The package .lpk andproject .lpi file use the following format :

     
   
     
     
     
   
   
     
     
     
     
     
   


And similarly
  
   
     
   
   
     
     
   


Is it possible to get rid of the counts ?

Reason: if 2 people add files to a package/project, it always creates
conflicts when updating from the VCS. And if you're in bad luck, you 
need to change a lot of items.


On the other hand, if you do
  
   
   
     
   

The chance of conflicts becomes less, and the resolution easier.

Michael.



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread DougC via Lazarus
+1 for switch to JSON!





 On Sat, 03 Mar 2018 06:11:19 -0500 Michael Van Canneyt via Lazarus 
lazarus@lists.lazarus-ide.org wrote 




Well, I originally wanted to propose switching to JSON, but I thought that

might be stretching the goodwill a bit too much...






-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread Michael Van Canneyt via Lazarus



On Sat, 3 Mar 2018, Graeme Geldenhuys via Lazarus wrote:


On 2018-03-03 10:15, Michael Van Canneyt via Lazarus wrote:


Is it possible to get rid of the counts ?

Reason: if 2 people add files to a package/project, it always creates
conflicts when updating from the VCS. And if you're in bad luck, you 
need to change a lot of items.



+1
This has been a long standing annoyance for me too. XML, JSON etc don't 
need count properties... That's relics from INI file formats.


Well, I originally wanted to propose switching to JSON, but I thought that
might be stretching the goodwill a bit too much...

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread Graeme Geldenhuys via Lazarus

On 2018-03-03 10:15, Michael Van Canneyt via Lazarus wrote:


Is it possible to get rid of the counts ?

Reason: if 2 people add files to a package/project, it always creates
conflicts when updating from the VCS. And if you're in bad luck, you 
need to change a lot of items.



+1
This has been a long standing annoyance for me too. XML, JSON etc don't 
need count properties... That's relics from INI file formats.



Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Package and project file format

2018-03-03 Thread Michalis Kamburelis via Lazarus
2018-03-03 11:15 GMT+01:00 Michael Van Canneyt via Lazarus
:
>
> Hello,
>
> The package .lpk andproject .lpi file use the following format :
>
> 
>   
> 
> 
> 
>   
>   
> 
> 
> 
> 
> 
>   
>
>
> And similarly
>  
>   
> 
>   
>   
> 
> 
>   
>
>
> Is it possible to get rid of the counts ?
>
> Reason: if 2 people add files to a package/project, it always creates
> conflicts when updating from the VCS. And if you're in bad luck, you need to
> change a lot of items.
>
> On the other hand, if you do
>  
>   
>   
> 
>   
>
> The chance of conflicts becomes less, and the resolution easier.
>

I am guessing the Count="xxx" attribute, and the numeric suffixes to
 ,  are there to read and write these files using
TXMLConfig class. Using TXMLConfig exposes an easy API to work with
XML files, but it limits what you can do --- all the children nodes
within the same parent must have a different name, so that you can do

File1 := XmlConfig.GetValue('Units /Unit1/FileName/Value');
File2 := XmlConfig.GetValue('Units /Unit2/FileName/Value'); 

In Castle Game Engine, we added some extensions to TXMLConfig, in
particular TCastleConfig.PathElement to address exactly this. It
extracts a DOM element (TDOMElement) from TXMLConfig, and then you can
use full power of the DOM unit to operate on this element (iterate on
children etc.):
https://github.com/castle-engine/castle-engine/blob/master/src/files/castlexmlconfig.pas#L258
. This way you can still use TXMLConfig API (GetValue / SetValue) for
some tasks, but you can switch to using more powerful DOM API for
other tasks.

I thought maybe this is helpful :)

Regards,
Michalis
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Package and project file format

2018-03-03 Thread Michael Van Canneyt via Lazarus


Hello,

The package .lpk andproject .lpi file use the following format :


  



  
  





  


And similarly
 
  

  
  


  


Is it possible to get rid of the counts ?

Reason: if 2 people add files to a package/project, it always creates
conflicts when updating from the VCS. 
And if you're in bad luck, you need to change a lot of items.


On the other hand, if you do
 
  
  

  

The chance of conflicts becomes less, and the resolution easier.

Michael.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus