PDA

View Full Version : Object version management



william chan
07-05-2009, 03:53 PM
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 (http://www.fd.com.my)
www.mercedes.com.my (http://www.mercedes.com.my)

Loopy Byteloose
07-05-2009, 04:52 PM
Linux has had a similar problem for decades and is quite organized about what is happening. They have a system that is based on 'distributions', 'software repositories', and viable 'versions' in order to allow everyone to do their own thing in a coordinated way. In this way, they optimize creativity and participation.

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 [ 黃鶴 ] in Taiwan

Leon
07-05-2009, 05:01 PM
The Microchip MPLAB IDE has version control hooks for Microsoft Visual Source Safe, PVCS, CVS and Subversion.

It should be quite easy to add something like that to the Propeller Tool.

Leon

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle

Loopy Byteloose
07-05-2009, 05:18 PM
This looks more appropriate and has a Windows binary as well as Linux. Subversion and CVS are client- applications that demand a lot from the user and the computer hardware.

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 [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/5/2009 1:08:07 PM GMT

Loopy Byteloose
07-05-2009, 06:11 PM
I just installed Git on my Ubuntu Linux side in order to test it out and explore. Frankly, I am quite enthused by what I see.

Essentially, for each stable bundle of objects one creates a ZIP file [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 [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 [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/5/2009 10:22:04 AM GMT

MGreim
07-05-2009, 06:35 PM
I am also using git, its very simple to use:
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

matb
07-05-2009, 07:49 PM
Use a 'distributed version control system' (DRCS) GIT is one, I use Bazaar (bzr) for propeller relatd stuff. Also have used Mecurial, it would also do the job.

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

Loopy Byteloose
07-05-2009, 07:57 PM
Thanks, I've a dual boot setup on my 64bit machine. I've now loaded both GitK in Ubuntu Linux and the Msysgit in Windows Vista [Chinese]. I am trying them both out and the only concern I have is that the Unicode may cause trouble. It appears that GIT may not have progressed beyond ASCII and runs into trouble with Unicode files.

Msysget does have the graphical user interface as well. And my original comments [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 http://forums.parallax.com/images/smilies/smile.gif

And we now have 3 choices to consider.

1. Git
2. Bazaar
3. Mercurial

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?

aka G. Herzog [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/5/2009 12:05:11 PM GMT

heater
07-05-2009, 09:13 PM
Is there a way to convert Unicode Spin files back to ASCII as God intended source files to be?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

BradC
07-05-2009, 09:18 PM
heater said...
Is there a way to convert Unicode Spin files back to ASCII as God intended source files to be?


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 :)

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!

heater
07-05-2009, 09:37 PM
Of course what I'm really asking is how to handle unicode Spin files in for example git. Or even just general tools like diff.

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.

WNed
07-05-2009, 09:42 PM
@William Chan - Addressing your original question.
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

BradC
07-05-2009, 09:52 PM
WNed said...
@William Chan - Addressing your original question.
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



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!

Loopy Byteloose
07-05-2009, 09:57 PM
So far, no problem in Ubuntu with Gitk.·The tutorial is·easy to read.·And it only took a few moments to set up a directory.

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 [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/5/2009 2:02:28 PM GMT

matb
07-05-2009, 10:29 PM
bzr does not like UTF-16 either, it treats them as binary files.
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.



file lib/FullDuplexSerial.spin
iconv -f UTF-16 -t UTF-8 -o dog.spin lib/FullDuplexSerial.spin
mv dog.spin lib/FullDuplexSerial.spin
file lib/FullDuplexSerial.spin




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

heater
07-05-2009, 10:43 PM
matb: Interesting, unfortunately it fails:

$ 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.

Loopy Byteloose
07-05-2009, 10:52 PM
Okay, a bit more of a progress report with Msysgit.

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 [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 [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 [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 [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/5/2009 7:29:41 PM GMT

WNed
07-06-2009, 12:04 AM
@BradC - I understand the concept of Softlinks, but when I tried to find out how to implement them, well, the word softlink does not appear in the Propeller manual, and the most applicable reference I found on the Microsoft site was how to implement a symbolic link in a C++ function. Softlinks might be my friend, if could get a proper introduction...

Ned

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno

Mightor
07-06-2009, 12:08 AM
WNed,

Have a look here: www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/ (http://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 (http://mightor.wordpress.com/)
| RobotC 3rd Party Driver Suite: [Project Page (http://rdpartyrobotcdr.sourceforge.net)] / [API Documentation (http://rdpartyrobotcdr.sourceforge.net/documentation/index.html)]

heater
07-06-2009, 06:52 AM
WNed: I think BradC might be talking from a Unix/Linux perspective. Where, for example, the command:

$ 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.

WNed
07-06-2009, 07:19 AM
You can use what MS calls "symbolic links" in Vista. I'm sticking with XP Pro and my barbaric naming scheme for the foreseeable future.

Ned

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno

heater
07-06-2009, 07:26 AM
WNed: Time for the famous quote:

"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.

WNed
07-06-2009, 10:18 AM
@heater - How about this famous quote, "The right tool for the job".
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

jazzed
07-06-2009, 11:32 AM
It would be easier if it was all ASCII :) If you install cygwin (not too big, I swear!), you can use symlinks on WindowsXP and get all the other wonderful GNU tools (not that you'll ever use Latex:).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

heater
07-06-2009, 01:27 PM
In the absence of soft links or version control systems etc you have to keep track of which versions you are using where manually so how about:

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.

Loopy Byteloose
07-06-2009, 04:48 PM
I still suspect that using something like GIT is a lot more user friendly once you get to know it. Computers have memories that pedantically adhere to routine while my mind tends to wander. Why not let the computer do the house keeping?

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. http://forums.parallax.com/images/smilies/yeah.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?

aka G. Herzog [ 黃鶴 ] in Taiwan

Post Edited (Loopy Byteloose) : 7/6/2009 8:55:05 AM GMT

stevenmess2004
07-06-2009, 05:04 PM
I haven't read all this thread so this may have already been suggested. What I do is to just keep a log in each file as I change it. I also include a version number in the filename of the top object. Then when I want to take a snapshot of a project you simply use create an archive using the propeller tool or bst. As you get more and more versions you can just extract any of the zip files and you'll have your project at any point in time. Not as flexible as git but you don't need to install anything extra on your system.

WNed
07-06-2009, 10:25 PM
@jazzed - I have cygwin, use it with Eclipse IDE. Together, they're a very pleasant work environment (even a bit more polished than some "professional" IDE's I've seen lately). The things I do are simply not complex enough to require a lot of mucking about in the command line arena. So, since I have cygwin, how do I use it to create softlinks for use with Propeller development?

@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

CounterRotatingProps
07-06-2009, 10:34 PM
> @professional developer horde ... naming obsolete versions appropriately is a simple and efficient "system" of version control.

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 ... :)

Say, whatever happened to William Chan, the orginal poster here?

cheers
- Howard

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

jazzed
07-06-2009, 11:21 PM
WNed said...
@jazzed - I have cygwin ... So, since I have cygwin, how do I use it to create softlinks for use with Propeller development?



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://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

WNed
07-06-2009, 11:28 PM
@CRP (Howard)- to be fair, I am/was (the economy) a professional developer as well, it's just that I'm more of a technician, cleaning up other people's messes, than I am an engineer. I've been using my current scheme since 1995, and it hasn't failed me yet. I never work with a large team, and my directory structure is maintained like a normalized database.
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... http://forums.parallax.com/images/smilies/wink.gif

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

rokicki
07-06-2009, 11:47 PM
We plan to move the schematic information *out* of sdspiqasm.spin specifically because Parallax chose to use UTF-16
and that doesn't play well with others. So we'll have schematic.spin (that does nothing) and all our source files will be
ASCII clean.

In the meantime, you're on your own.

By the way, we've adopted mercurial for the fsrw project; the thing I like about mercurial (and its command line tool hg)
is that it is really simple (and it's distributed, which means full history and all your changes are on your box, no matter
what sort of network connection you have). But yes, the other tools should do the job too.

heater
07-07-2009, 12:11 AM
Jazzed: "Non-ASCII files like spin could be committed as binary type"

Ouch, that's not nice. Half the point of a version control system is to be able to compare source of one version against a different version to see what you broke (err.. changed) last. Committing as binary throws that possibility out the window. Better to convert the Spins to ASCII.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

BradC
07-07-2009, 12:14 AM
rokicki said...
specifically because Parallax chose to use UTF-16


Actually, I'm not sure it was a deliberate design choice on the part of Parallax. Microsoft chose UTF-16 for Windows unicode handling. My mother tells me if I don't have anything nice to say I should simply not say anything at all.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Missed it by ->" "<- that much!

jazzed
07-07-2009, 12:18 AM
heater said...
Jazzed: "Non-ASCII files like spin could be committed as binary type"

Ouch, that's not nice. Half the point of a version control system is to be able to compare source of one version against a different version to see what you broke (err.. changed) last. Committing as binary throws that possibility out the window. Better to convert the Spins to ASCII.

Absolutely. Fair argument for just using ASCII http://forums.parallax.com/images/smilies/wink.gif Although you could still use "diff" on the files ... but that would be inconvenient.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

rokicki
07-07-2009, 12:22 AM
BradC said...

rokicki said...
specifically because Parallax chose to use UTF-16


Actually, I'm not sure it was a deliberate design choice on the part of Parallax. Microsoft chose UTF-16 for Windows unicode handling. My mother tells me if I don't have anything nice to say I should simply not say anything at all.


Microsoft chose UTF-16 as an *internal* format for Unicode.

Most Microsoft tools, when serializing Unicode text, write it out in UTF-8 by default.

Many developers think just because the in-memory format should be UTF-16, that the external
format should also be, but that's fallacious.

BradC
07-07-2009, 12:31 AM
rokicki said...

BradC said...

rokicki said...
specifically because Parallax chose to use UTF-16


Actually, I'm not sure it was a deliberate design choice on the part of Parallax. Microsoft chose UTF-16 for Windows unicode handling. My mother tells me if I don't have anything nice to say I should simply not say anything at all.


Microsoft chose UTF-16 as an *internal* format for Unicode.



I still don't have anything nice to say about them! ;)


rokicki said...

Most Microsoft tools, when serializing Unicode text, write it out in UTF-8 by default.



On that point I can't comment. I must admit to having *never* used a Microsoft development tool outside of GWBasic, and I don't recall that supporting Unicode.


rokicki said...

Many developers think just because the in-memory format should be UTF-16, that the external
format should also be, but that's fallacious.


Agree completely. And it's not as if translating is difficult (although heater has pointed out I appear to have a bug in my UTF-8 writer, so it's not quite as easy as I thought obviously!). I suspect (and this is pure speculation) it's more that the editor component that was used in the IDE has an inbuilt stream read/writer that generates/reads UTF-16.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Missed it by ->" "<- that much!

matb
07-07-2009, 05:17 PM
@heater

I used iconv to convert UTF-16 into UTF-8.
Diff (and hence RCS's) seemed to work OK with UTF-8.

To force it to ASCII, use -t ASCII//IGNORE

I still maintain UTF-8 is good enough. You will note a diff actually shows the change properly after the conversion.
When I did this I found my UTF-8 was just from the dumb box characters around the file header/footer.

By converting to UTF-8 you are not actually changing anything, so getting a update from the author is easy to merge/diff.

heater
07-07-2009, 07:30 PM
@mtab:
I only just discovered iconv and have been playing with it a bit.

The first problem I have is with git which I am looking at for both hobby and real work use.
As you say doing a normal diff on UTF-8 files seems to work reasonably well. However asking git to do a diff between versions does not work. "git diff" outputs a diff showing all lines of the file were removed and then all lines added back. Somewhere in the middle of all that being the one line change I made which happened to, say, move a resistor symbol. Hence the desire to convert to ASCII only.

Second problem is that BST can be set to always save files as UTF-8 but when using iconv on the resulting files to convert them to ASCII it fails with an "incorrect encoding" on input error. BradC thinks he has a bug in the UTF-8 output of BST.

So unless there is a magic switch in git to make it work with UTF-8 I'm a bit stuck for now.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

matb
07-08-2009, 09:01 PM
@heater

bzr diff is fine with UTF-8, it just uses the stock diff.

man git-diff shows there is --color-words, sounds like what you want.
I tried that and it works great, even when my change was converting UTF-8 to ASCII.

I think I could get like git!

Rambling from before I set up got to try it out...

Apart fro mgit, most command line RCS tools present their diff's on a line by line basis. Character by character diffs are usually left for the GUI client to implement.
Pretty sure Meld will does character by character. Gvim definately does a character by character diff. There are probably gvim plugins for git to do a diff on the current file. Gvim also understands diff unified output.

Back in the day, using CVS, I would generate a unified diff of the entire tree, and display in gvim. From there you could split open any file of interest, and then diff it against the RCS, you got a character by character diff that way, that you can edit or revert. You probably still can't get a tool that is more efficient for patch reviews.

heater
07-08-2009, 09:34 PM
matb, thanks for the push, I tried that diff again, with and without color-words. It actually worked nicely. Not sure how I got it wrong before.

Think I'll be giving git a good try out.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.

jazzed
07-08-2009, 09:38 PM
I like using WinMerge winmerge.org (http://winmerge.org) for Windows. It seems to handle utf'd spin files just fine.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)