Visual Source Safe Pinning Feature

June 12th, 2007 by Sameer | Filed under Visual SourceSafe.

 We have run into the situation before where we are developing code, but we don’t want other developers to get that code yet because it is not completely developed yet.  However, we still want to take advantage of Source Control and put it in the repository so we have incremental changes and we can rollback incase we do something dumb.  Our first solution to this was to use a “ready” label and then instead of getting latest version, we would do a “Get label ready”, and then the ‘ready’ label was updated when the code was more stable.  However, this didn’t work very well, and maybe it would have made more sense to use many different ‘ready’ labels, such as ready1, ready2, ready3, etc.. so that if we ever needed to revert to an older one, we could do that. 

 

However, there is a better way to accomplish this with sourcesafe, its called “Pinning”

I created a test.txt and here is the contents: blah blah version 1

Version 1 test.txt–

blah blah version 1

Version 2 test.txt–

blah blah version 2

Version 3 test.txt–

blah blah version 3 BROKENNNN!!!

 

SourceSafe Pinning Feature Screenshot

Now when you do a get latest version on the file or containing folder, it will give you version 2 (blah blah version 2), not version 3 – BROKENNNN!!!

Here are some more References:

Update (June 29, 2007) – If you pin a file, you CANNOT check it out and continue to work on it.  As usual, SourceSafe takes the cake!  Pinning could have been the perfect way to indicate "this version is stable, so get that one, while i continue to work on it", but it ended up being otherwise :(

Here is a blurb from that page:

Use of Pins in Version Control

Visual SourceSafe defines a pin as a marker that designates a specific version of a file as the version that is part of a project. The pin is represented by a pushpin icon, and is added through the Pin command in the History of <name> dialog box. For more information, see How to: Pin a Version.

You can pin any file, but you should do this only when you are not planning to change the marked file. Pinning is most useful when applied to shared files.

 

Note

Note   When you pin a shared file, you cannot make changes to it until you unpin it using the Unpin command from the History of <name> dialog box.

If you share a pinned version of a file, the projects sharing the file cannot change it. However, if you share an unpinned file, and then pin it in one project, other projects can still change and update the file.

Let’s examine an example of using pins for version control. One developer has prepared a spell checker program. The first time the version of the program is stable, the developer uses pins to mark particular versions of the program code files. He then notifies a developer of a grammar checker program that uses the spell checker code that a good version is available. The second developer can share and branch the code and use the pinned file versions as the basis for his spell checking components of the grammar checker program. He only obtains the last known good code files for the spell checker, unless the first programmer unpins his file versions at some point.

Other Interesting Posts

4 Responses to “Visual Source Safe Pinning Feature”

  1. Antonio says:

    Pinning individual files is useful but how do you pin entire folders and sub-folders?!

  2. roy davis says:

    I am looking for the same information. How do you pin folders and subfolders. I tried the command line route but “ss pin” doen’t take the -R parameter.

  3. vernon wing says:

    in a development environment an object must be updatef for mulitple ongoing projects under one application. Not knowing which project will be implemented first, there is a need for parallel updates to the same parent object. Eventually when both projects come together, then a merging of the child latest child object versions are needed. Meanwhile I want VSS can keep track of various file version changes. Can this be achieved using PINNING feature?

  4. Sorry I don’t know how to answer your question. However, if you are doing multiple parallel development I highly suggest going for a more powerful software such as Subversion

Leave a Reply