Studio 4 and code versioning system

Go To Last Post
27 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All,

Does anyone have an easy way to track versions of assembler without using an external system like CVS? I make changes to source, and run it - it works.

Next time I make a change or add more code - it breaks. I'd like to save off each version so I can simply revert to the "last known running" version.

I'd like to do it within Studio 4 but find no reference for saving versions. I will do "Save As" but since the project does not get saved with the new "Saved As" version of source code, it get's messy, time consumng and error prone.

Anyone have favorite techniques or suggestions?

Thanks.
Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bb56 wrote:
Anyone have favorite techniques or suggestions?
Yes, but you maybe won't like the answer.

One of the reasons I avoid IDEs and use command-line tools and a powerful stand-alone editor is that I can mix and match the tools I like (or have to use, in case a customer has a particular version control system, but can otherwise keep my environment).

The stand-alone editor is configured so it can check out individual files from a version control system, or fetch a complete repository. It is also set up so it can check-in / commit files, but that isn't very important.

The build system gets checkin and checkout commands. The build system anyhow knows all files making up a project, so it can use this list for a bulk checkin. It can also check out files, in case a file isn't there but needed for a build.

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Arnold. You describe what I remember of the S/W dev environment with a dedicated version control system. I don't really want to go that way, so you're right - I don't like it.
I figured there are some clever folks on this forum that might have already thought up their own system when using Studio 4. A thread back in 2003 on this same topic went unanswered. So I'm probably on my own with this.

B

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bb56 wrote:
Does anyone have an easy way to track versions of assembler without using an external system like CVS?
Why don't you want to use CVS? I use CVS with the WinCVS front end GUI for version control of source files (AVR, Visual Basic, etc.) and other files (binary as well as text).

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I don't really want to go that way, so you're right - I don't like it.

So you want to do version control without using version control? I don't get it. SVN, CVS, GIT have been developed over the years to offer all that's best in version control. Why wouldn't you just use one of those? It's very easy to set up an SVN repository and then use something like Tortoise as a GUI client to it.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All sound advice - thank you.

I guess I'll look into using CVS for my "Tiny" programs. I really don't have plans for large processors or large code projects, so I was looking for a simple solution.

In my past, I had 30 developers checking modules in and out and coordinating it all with a release manager. Now it's just me - trying to avoid complexity in my small dev environment.

Thanks for the rationale and persuasion for CVS.
B

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CVS is really old tech, thing of the pass. Try using mercurial, git or bazar, I personally use mercurial (hg) and is awesome. In that way you learn new stuff while doing small project and get familiar with the tool, etc...

good look.

---
ARod

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bb56 wrote:

Does anyone have an easy way to track versions of assembler without using an external system like CVS? I make changes to source, and run it - it works.

It would be nice, wouldn't. I have exactly the same problem, spent all weekend getting an app to print floating point numbers correctly, then spend an hour getting it to do negative ones!

Everything OK, just one last minor change and damn, its won't print anything now.. and because I went to make a cup of tea I can't remember what that last tweak was, so it will take me thirty minutes to fix it :(

What I do is break my project into lots of modules (e.g. keyboard.inc) when I want to backup I save as XXXX.bak then immediately do another save as XXXX.inc.

You have to be religious about it or you end up modifying the bak file and compiling the inc file...

It would be a major bonus if you could tell Studio 4 to keep a trail of previous versions automatically, either with a save restore point button, or just keeping a number of previous saves.

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeyAVR wrote:
It would be a major bonus if you could tell Studio 4 to keep a trail of previous versions automatically, either with a save restore point button, or just keeping a number of previous saves.
Well, something like that does exist, although in a very BF&I (Brute Force and Ignorance(tm)) form: So long as you do not leave the editor, you can reverse changes out using the Undo function on each file. Of course, it is up to you to remember where the last "save" was, which file was modified, never leaving AVR Studio, etc.

Next suggestion: set up some kind of script that copies all of your source using some kind of renaming algorithm (as you suggested above), then call that script from a Makefile that builds your source. Thus, every time you build, you get a new copy of the source.

Is anything built-in? No. Can you hack your way to what you want? Of course! Will it be "better" than CVS/SVN/mecurial/git/...? That depends on your value of "better". :twisted:

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
So long as you do not leave the editor, you can reverse changes out using the Undo function on each file.

Every time I build, it saves all open files and clears the undo history. Am I missing an option?

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Every time I build, it saves all open files and clears the undo history. Am I missing an option?

Yes, it's saving the file you edited ON TOP of the previous version. With code control systems each time you choose to save ("check in") it shuffles them all down a pile and puts the new one on top. At any time you can say things like "take me back 3 versions" or "show me what was different between version 31 and 35" (i.e. all the changes applied by 32,33,34 and 35)

On the occasion that you work for a few hours, make loads of changes and then you render the code unworkable you can compare it against the last version saved and selectively enable/disable each change you made until you find what broke it.

The clever bit of code versioning systems is that they don't really hold all of version 1,2,3...31,32,33,34,35 but hold a full copy of version 1 and then just the "deltas" (changes) at each subsequent version. However they can reconstitute the entire copy of any chosen version.

They'll also generally have some decent "diff" tools for showing what changed between versions and also for allowing changes from two sources to be merged.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I understand that, but I tend to make a few changes and do a build every 5-10 minutes. Stu's post suggests that Studio will let you can undo to a point before a build, but I can't see how I can do this without the sort of extras you suggest.

It's a bit clumsy but I think I'll write a utility in wonderful BBC basic to give me a nice windows interface to create just such a 'shuffle chain' of past versions. The files are generally so small that a plain copy and rename will do.

It will be easy to add a back up to CF utility as well.

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can always do a save with each build via your external makefile. Possibly by saving a filename made by appending a version# to the current C file being compiled. You just arrange as part of the built-in rules.

But this will not cover dependent header files etc.

If you want something efficient, stable and reasonably foolproof you will use an existing SCCS.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No makefiles in ASM...

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

No makefiles in ASM...

OK, here's a mad idea. I just replaced avrasm2.exe with a .exe made from:

#include 
int main (int argc, char * argv[])
{
	int	n;
	
	for(n=0; n

I then tried to "build" an asm project in Studio and the output was:

arg0 = C:\Program Files\Atmel\AVR Tools\AvrAssembler2\avrasm2.exe
arg1 = -S
arg2 = C:\Users\Cliff\Downloads\Documents\labels.tmp
arg3 = -fI
arg4 = -W+ie
arg5 = -o
arg6 = C:\Users\Cliff\Downloads\Documents\asmtest.hex
arg7 = -d
arg8 = C:\Users\Cliff\Downloads\Documents\asmtest.obj
arg9 = -e
arg10 = C:\Users\Cliff\Downloads\Documents\asmtest.eep
arg11 = -m
arg12 = C:\Users\Cliff\Downloads\Documents\asmtest.map
arg13 = C:\Users\Cliff\Downloads\Documents\asmtest.asm

So what you do is actually replace this short program with something that really does invoke avrasm2.exe with all those passed command line options but it would ALSO invoke the "check-in mechanism" of whatever CVS style system you chose to implement.

In effect this adds "makefile like" capabilities to the Studio Asm build process. ;-) It could even invoke make.exe or maybe just process its own style of cut-down makefile?

Cliff

Last Edited: Tue. Oct 13, 2009 - 01:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not wanting to seem thick - create an executable that does the filebackups, then issues a command line call to AVRASM2.exe.

Quote:
Maybe just process its own style of cut-down makefile?

Just about within the scope opf my expertise. Just...

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I want to do a AVRASM2 project, I would use make.

Or you can produce a MSDOS batch file if you are a masochist.

The Studio IDE for driving AvrAsm2 is pretty simplistic. You either take it or leave it.

You can use other IDEs if you like. AcrAsm2 runs perfectly well from the command line, so an IDE can invoke it just the same as any human being.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But, but, ....

Quote:

It's a bit clumsy but I think I'll write a utility in wonderful BBC basic to give me a nice windows interface to create just such a 'shuffle chain' of past versions. The files are generally so small that a plain copy and rename will do.

In that time I would have searched for and found the latest version of TortoiseSVN client for Windows, install it, set up a file repository somewhere on the same machine (no need to set up a server - it works natively on the file system), and checked in the project. Then at appropriate points, have a Windows Explorer open to the app directory, R-click and choose "SVN Commit", add comments and away it goes.

I'm just trying to understand the mental block you have against that. I don't know the other VC systems but I can answer questions about SVN on Windows.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Second the use of eg SVN. Get the command line version also. Then, as simplistic as the AVR Studio assembler project handling may be, it can actually run a command of your liking before or after assemblying, so so there you do a

svn ci 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rledyard wrote:
But, but, ....

Quote:

It's a bit clumsy but I think I'll write a utility in wonderful BBC basic to give me a nice windows interface to create just such a 'shuffle chain' of past versions. The files are generally so small that a plain copy and rename will do.

In that time I would have searched for and found the latest version of TortoiseSVN client for Windows...

Available here: TortoiseSVN
Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rledyard wrote:
I'm just trying to understand the mental block you have against that. I don't know the other VC systems but I can answer questions about SVN on Windows.

It's ignorance in action. Why download 18meg of complex stuff I don't understand when I can homebrew something simple that wastes only a few K?

Seriously though I've downloaded Tortoise SVN. I'll give it a go - if I get stuck I know who to yell for!

Cheers,

Joey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Why download 18meg of complex stuff I don't understand when I can homebrew something simple that wastes only a few K?

Things like GIT and SVN are developed to cope with every possible thing even the most complex programming team might ever hope to do. While I'm a fan of both SVN and GIT after many years of having been stuck using Microsoft Visual SourceSafe there are other, less complex code control systems available. Try a Google for "Mercurial" for example. But you may end up having only command line access tools.

If you do manage to build a code versioning database in only a few K you will win major awards!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Try a Google for "Mercurial" for example. But you may end up having only command line access tools.

There are Tortoise variants for both Mercurial and Bazaar:
http://bitbucket.org/tortoisehg/...
http://bazaar-vcs.org/TortoiseBzr

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You guys, please try hg/git/bazar. the merge process is way orders of magnitude better than svn.

---
ARod

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a local SVN server on my Linux-Server
For windows i use TortoiseSVN as most other people , and WinMerge as diff viewer http://winmerge.org/.

For a neat Linux GUI i use RapidSVN and "Meld Diff Viewer" , Btw. Bless is a nice linux hexeditor.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course, VIm allows you to go back/forward in time, for example writing:

:earlier 10m

Gives me the file in its state 10 minutes ago.

For version control I use git though, great to commit offline changes and then push them all to a master repos when the feature is complete.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

and then there's versioning file systems that keep track of changes in your files, like Wayback for Linux.

I like cats, too. Let's exchange recipes.