Object version management
william chan
Posts: 1,326
Sometimes I made some major changes in an object file and I want to change it's name so that I can easily recognize the new version.
For example, DuplexSerialv1.spin is changed to DuplexSerialv2.spin
But then all projects also need to be modified their source to use the new object.
How do you guys manage your object versions?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
For example, DuplexSerialv1.spin is changed to DuplexSerialv2.spin
But then all projects also need to be modified their source to use the new object.
How do you guys manage your object versions?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
Comments
They also have developed and include software applications that track changes and keeps a database for individual developers or groups of developers working together on one project. These applications might be called revision control or version control tools. VCS is the most popular in Linux - Subversion is another; but these may be too much for a single machine. There are others that are smaller and simpler. I am away from my reference book. So I cannot find a suitable suggestion for Windows.
SEE Wikipedia
http://en.wikipedia.org/wiki/Revision_control
http://en.wikipedia.org/wiki/Comparison_of_revision_control_software
I suspect that these open source software applications could be used to keep track of all your changes in an orderly fashion. That can include BasicStamp, Propeller, and SXes!!! Many do things automatically so that you don't forget which file is the most recent. There are versions available for Windows and some are just for one development machine.
I'd stay away from having a multi-machine application unless I had to because you are likely to need to create a file server and a database server to manage all the changes occuring independently by other users. The task become much more complex at that point.
It would be quite helpful for Parallax to take the lead and create its own listings of 'distributions' and its own 'software repository' in a rigorous format for all of us to follow. They might also suggest a development tracking software package that is appropriate - maybe a few.
Until then, keeping your own database would be quite helpful. It could be done in Excel if you are diligent at inputing updates. You also have a utility that compares files for changes in the Windows command line. This is an important tool to sort out changes. Nonetheless, I thing we would all agree that such an approach is likely to get quickly tedious and that we would prefer having the power of the computer do the work rather than having to remember.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
It should be quite easy to add something like that to the Propeller Tool.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
There is some discussion of CVS as an example of what-not-to-do. I need something that will keep a lot of small projects in order.
http://git-scm.com/download
http://en.wikipedia.org/wiki/Git_(software)#Design
So one might try GIT from Linus Torvalds, the originator of Linux. He certainly has a good reputation. Generally, my file system gets a lot of clutter every time I get creative.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/5/2009 1:08:07 PM GMT
Essentially, for each stable bundle of objects one creates a ZIP file [noparse][[/noparse]or the Linux counter part of a a ZIP file which is a TARball]. These ZIP files are stored in a directory that is dedicated to one topic, say Propeller objects. If you want to start a new project, you use unzip the bundle in the Propeller default directory for work. When you are finished or if you want to shift to another project, you just ZIP that directory and store it in the appropriate Git directory. You can have several thing in progress. But you have to have the discipline to manage ZIP and unZIP appropriately, to create a good set of working directories and Git depository directories, and to learn how to use Git. It really doesn't seem that much to master.
As of yet, I am only look at the Linux version. I will have to try to install the Windows version in Vista later. I am quite optimistic. You can always keep a ZIP or TARball of the original Parallax code at any point in time to revert to. And Git is supposed to seek out changes within the file, not by file name. In the code, that means that you may not have to make file name changes throughout in order to get a customer version to operate. The ZIP file name and a readme file can indicate what is not standard.
I'd strong suggest that you forget CVS or Subversion unless you are very ambitious. All Parallax has to do is to bundle objects together in a ZIP file that has been tested for working together - these may be grouped by Propeller Demo Board, Hydra Gamer Board, PropRPM Board, Propeller Prot Board as different 'distributions' of the same code. The user can unZIP without GIT or use GIT as they choose. So it is a WIN-WIN for everyone. Those who right multiplatform objects can just provide the code as a multi-platform distribrution and that can have one default [noparse][[/noparse]such as the Propeller Demo Board] to be reconfigured by the end-user.
In sum, this is do-able and would greatly enhance our fun!!!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/5/2009 10:22:04 AM GMT
Very short manual:
first work with the propeller tool as usual.
The only thing i would recommend
to have all used spin files in one subdirectory.
After you have installed git first step is (on the command line)
C:>userdir>git config --global usewr.name "Mister Minit"
C:>userdir>git config --global user.email "mister.minit@t-online.com"
or so.
Then for the first time go to your userdir
C:\programes\parallax\myfiles
and say
git init ' the a subdirectory .git is created
git add *.spin ' you may also say *.* to track all files
the after a long day of programming say
git add *.spin ' again if you had created new files and then
git commit -m "I have now created a new Turing machine on the propeller folks or so" ' this is your comment
with
gitk
you get a grahical user interface showing all your added and deleted files, you may roll back things or make so called branches,
you may put your file on a web reposotory, distributed developement on different PCs and by differnet persons, and so on...
..thousands of things..
I recommend the book 'Pragmatic Version Control Using Git' by Travis Swicegood
Very simple to read and to understand.
Maybe in the nect Propeller-Tool version an interface to git would possible???
Markus Greim
The non-distributed ones, CVS, svn are not so easy to adapt for typical.
The distributed ones treat a controlled directory-tree as a self sufficient structure. If you want, copy it to a different PC, say a laptop, and they both keep working, and provide a few ways to track and merge back in the changes.
In my bzr setup, I do a 'checkout branch' from a USB stick, which copies the tree from the stick, but retains a link back to the stick. Every time I commit it goes to both my local branch, and the USB stick. If the stick is not there (or is lost) my local one is still good, and one command unlinks it from the stick. To share changes with another laptop, just plug in the stick and update its local copy. I use bzr as this checkout mode is perfect for lazy people like me who do not backup very frequently (ever).
So a DRCS will let you coordinate changes within a group of files.
Thats good, but still does not solve the situation you described if you are using some Objects as libraries shared across multiple projects. There is a common solution for this too, which is a 3 level version numbering scheme, major.minor.revision e.g. 1.2.3 Changing the major means a incompatible change, i.e. the existing interfaces have changed, the minor means new features added but existing interfaces still work, and the last number is for bug fixes. Usually the file is named with the major version in the name. Matching up minor version dependencies is normally left to some other mechanism.
So for prop shared objects, put a single number in the name, and only change it if you change the interface. Put the other numbers in comments in the source file. Use the DRCS to manage your file versions.
Now in your example, you would have to decide if that was a major or minor change, did the existing interfaces change so old code will not work. Sounds like they would still work, so no need to rename, trust the DRCS do the work.
Post Edited (matb) : 7/5/2009 11:54:58 AM GMT
Msysget does have the graphical user interface as well. And my original comments [noparse][[/noparse]in above postings] about ZIP files may be wrong as they appear to be done in the background by Git. Git does provide its own Zip software during the installation. I chose only the most stable Windows configuration choices as I am still learning what the software really does.
Still, the main thing is that I don't have to set up a client-server system to do revision control and that the directories are quite containable. As Parallax is all about newcomers and hobbyist, the small learning curve is ideal. The fact that it is used in major way for the Linux Kernel and other project indicates that it will be well maintained. And of course it is FREE to everyone.
This really looks quite easy
And we now have 3 choices to consider.
1. Git
2. Bazaar
3. Mercurial
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/5/2009 12:05:11 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I have a program I created to do it, *but* (there's always a but), it takes non ASCII characters and substitutes '?' in their place. It's not difficult to translate the Parallax characterset from unicode back to straight 8 bit as the Parallax font only has 256 characters in it [noparse]:)[/noparse]
I do it in the compiler to remain compatible with the Parallax compiler, but the converted result never leaves the compiler as it gets ugly outside $20-$7F range.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Missed it by ->" "<- that much!
Looking at MoCog for example, turns out I have one unicode file in there, sdspiqasm.spin.
If I ever make a change to that file, especially editing the nice schematic in there, then diff, git diff, etc are not going to show me the changes in any sensible way.
Also, until such times come that compilers actually attach meaning to hieroglyphs I don't think they have any place in source code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
If you're a hobbyist and don't need to get into the level of the previous discussion, consider leaving the newest version with the original name for the sake of compatibility, and rename the older version... something like FullDuplexSerialv1.spin.old
Works for me, but I don't have anyone else working on my projects, and I'm not compiling differing versions of Linux on my Prop.
Ned
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
Softlinks are your friend
Serial_001.spin
Serial_002.spin
Serial_003.spin
Serial_Current.spin -> Serial_003.spin
So each time you create a new version you simply update the softlink to point to the new one and all your code that references "Serial_Current" automatically gets the latest version. It's how I do all the USB stuff, and it makes life frighteningly easy. In addition, if you *have* to reference an old version, you can do so by name.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Missed it by ->" "<- that much!
I have moved over ot Msysgit in Windows Vista Chinese and it is pretty straightforward, but details are slightly different.· So, you should start Msysgit in the Git Bash screen and type "Git info Git" to get the software to open documentation in an Html screen. From there, you can mouse on the tutorial and sort out all your specifcs.·· That is what I am doing now.
You don't need such software, but after a while your Propeller files do get a bit messy and your memory or documentation style may fail you. That's when it is nice to have the computer do your housekeeping.· Also, if you decide of collaborate at some point, all work is stamped with who generated the code and provides an email address to contact·them.
I have been looking at Revision Control software for nearly a year and was unwilling to comit to the more evolved set ups.· This one looks much more 'user friendly' and actually may make using the Propeller more fun -- at least for some of us.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/5/2009 2:02:28 PM GMT
Once I realised the problem I converted everything to UTF-8, which works well enough with source code tools.
The linux tool to convert is iconv. Use the file command which tries to detect the encoding UTF-16/8/ASCII. Example usage below.
unfortunately does not seem to have a in place file replace option, so you have to mess about with temp files, and not easy to use find to do a whole tree.
Post Edited (matb) : 7/5/2009 2:34:16 PM GMT
$ file sdspiqasm.spin
sdspiqasm.spin: UTF-8 Unicode English text, with CRLF line terminators
$ iconv -f UTF-8 -t US-ASCII -o temp sdspiqasm.spin
iconv: illegal input sequence at position 349
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
1. GIT BASH is Linux directory syntax. That means that it is a little less intuitive than Microsoft Command Line. If there is a space in the file name one has to use quotes or it will only see the first word. For example My Docments will only see My and reply no directory exists with that name, whilst "My Documents" will locate it.
2. Slash and Backslash are in a Unix/Microsoft muddle. So use / with Bash. If you don't understand BASH, you may have to read a Linux/Unix tutorial for it. Alternatively, use Windows to create your working GIT directory and use the GIT GUI to initialize and manage all the usual stuff. Stay away from GIT BASH for most things unless absolutely necessary.
Having said all that. I don't know what to make of the UTF-8 or UTF-16 issues as I am stuck with Vista Chinese and haven't done much SPIN programing in it as of yet. Also, Vista is like Linux in that it generally wants a logged on user to do their work within their home directory tree [noparse][[/noparse]look under /user for your log in] and NOT save new work to the "Program Files" sub-directories where Parallax IDES reside. So in your home directory tree, you should create a working directory for Propeller Spin, SX, and PBasic. Subdirectories should include working GIT directories. From there it should be fairly straight forward to see how useful GIT really is. The working GIT directories can copy the complete Propeller Library from the Program Files area [noparse][[/noparse]it is handy to keep an untouched archive just in case] at startup and then use the Git Add command to have them recognized as your starting point. They become GIT 'master' files.
Above all, read the tutorial provided in Windows [noparse][[/noparse]not Linux] in order to learned. All the documentation comes with the installed software. Good luck.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/5/2009 7:29:41 PM GMT
Ned
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
Have a look here: www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/
Regards,
Xander
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
| Current projects and ramblings: I'd Rather Be Building Robots
| RobotC 3rd Party Driver Suite: [noparse]/noparse][url=http://rdpartyrobotcdr.sourceforge.net]Project Page[/url / [noparse]/noparse][url=http://rdpartyrobotcdr.sourceforge.net/documentation/index.html]API Documentation[/url
$ ln -s something_0_1 something
creates a soft link from something to something_0_1 such that, for example:
$ cd something
actually changes you to the something_0_1 directory.
Perhaps nowadays it is possible to do this kind of thing in Windows as well. I have no idea having never used Windows for anything serious.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Ned
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer
It's taking the Windows guys a long time to catch up.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
I use my Linux boxes for Linux stuff, I use my MS boxes for MS stuff I use my AS/400's for AS/400 stuff. I am not a religious zealot for any OS, protocol or language. Now let's give William Chan his thread back, OK?
Ned
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
1. Keep each version of each object in a separate directory DuplexSerialv1, DuplexSerialv2 etc.
2. Keep each version of each of your projects in a separate directory MyProject1v, MyProjectv2 etc.
3. Within each directory the spin files keep their base names e.g. DuplexSerial.spin
4. Copy the files of a version of each object into whatever project is using them.
5. Do all the project building from one directory.
6. Keep a note of which version is in use in each project in some text files in the project directories.
May be a lot of copies, but spin files are never going to be very big, and this saves having to go around changing any source files.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
About the only challenge that I see with GIT is the GIT BASH uses Unix/Linux file directory notation. For those of us not versed in Linux, it takes a little getting used to as you try to make things work the Windows way. But, Bash offers one a heck of a lot of versatility. There are on line tutorials and for real enthusiast, whole books have been written on using Bash {I'll never read one.}
I did easiily establish working GIT directories with master copies of all my Parallax IDES - BasicStamp, SX, and Propeller. And I am now reading the interesting HTML documentation to see exactly how to best use it.
I suspect that I keep the Master and move to individual projects that clone the whole library. In that way, I can go back to a clean copy of the Parallax Spin Library at anytime. This program creates a SHA-1 hash number of each group of files. That very quickly tells you if they are exactly the same or different. One can build in stages and revert to earlier stages if the code is no good.
Of course, I have some friends that are still trying to do everything in DOS and DOS batches because that was once and still is their comfort zone. I just rather have a housekeeper than be the housekeeper. I also send my laundry out as I feel sitting in a laundromat is an inhumane way to spend one's free time. Each to one's own way.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/6/2009 8:55:05 AM GMT
@professional developer horde - I still maintain that simply using the original name for the current version of each object, while naming obsolete versions appropriately is a simple and efficient "system" of version control. It requires absolutely no maintenance in any source using the object, it requires no installing, configuring and learning of new software, and is certainly enough for the average hobbyist. I have no idea what skill level the original poster of this thread is at, since he's remained silent throughout the discussion.
Ned
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
as one of the horde, I'd say, sure, why not? As long as you have a system that works consistently for you - the real test is when you have to come back to some specific version of the code after 1 year of not looking at the whole project or thinking about it. If you find it in a few minutes, great, if you loose your mind after ten minutes of hunting, file-name searching, or 'grepping" for strings ... then ... well ... [noparse]:)[/noparse]
Say, whatever happened to William Chan, the orginal poster here?
cheers
- Howard
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
In command window and directory use:
ln -s <source path/file> <destination path/file>
I use CVS with Eclipse and am quite happy with it. Non-ASCII files like spin ccould be committed as binary type. I've used CVS professionally with no problems for 20+ years.
As far as Spin revisions go, I usually just tack on a number to my .zip archive file and forget about renaming the spin files (which I find just friggin annoying anyway). Using zip is just as effective to me as anything else in a "single user" environment.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
For a few years, I was a full time VB team leader and briefly tried implementing Source Safe... and now I'll spend the next three sessions with my shrink talking about that again...
Ned
... oh, William... William Chan... where are you....
@Steve - saw your post after I'd already written the above...
At the risk of vearing off topic wildly... I misspoke earlier. I tried using cygwin with Eclipse originally, but never did get it to recognize the compiler. Found a nice tutorial for MinGW, and as they say, whatever works... so I'm using MinGW with Eclipse.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
Post Edited (WNed) : 7/6/2009 4:16:36 PM GMT