Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Label limitations

Tags:

tfs

A blog states

Labels come with a big warning though - labels themselves are not version controlled, meaning that there is no way to track or audit the history of activity on a label. Plus, labels don't keep copies of versions in case of a file deletion, so if a file gets deleted, any label that relies on a version of that file is essentially hosed.

This is not the only place I've read similar information regarding TFS labels. The lack of history is clear enough. The second part "labels don't keep copies of versions..." is unclear. In fact, I created a test project > labeled it > deleted a file > performed a Get by Label and the file came back. So what is this referring to? Has the label functionality changed in TFS as of recent?

I realize that a file deletion does not actually remove history, is that the cause? In other words, if I run

tf destroy "$/MyTeamProject/Project/FileName.cs"

Is that what it means to delete a file? If so, that seems an extraordinary circumstance to even consider. I mean, its an intentional unrecoverable deletion of history. Changesets are not going to be any improvement over labels in such a case.

like image 667
P.Brian.Mackey Avatar asked Mar 30 '12 17:03

P.Brian.Mackey


People also ask

How do labels limit our understanding?

The tendency to label ourselves and others can blur the lines between truth and fiction. It can create tension between who we think we are supposed to be and who we actually are. If unchecked, it can lead to mental health issues that can compromise our quality of life and relationships with others.

What is the importance of reading and understanding the product labels?

Ingredients: The label on a product allows the customer to know what is in the food they're eating or the product they're using. This allows the consumer to know how healthy, or unhealthy, the product is. It's also important to display the ingredients for those who may be allergic to certain ingredients.


2 Answers

When we apply a label we do so to a version of source control at a point in time. Intuitively, because we initially created a snapshot of source control at a point in time one may assume the snapshot represents source code at a point in time.

This is incorrect. Labels can be edited after creation.

Conceptually, a label defines a product and the product’s bug-fixes (source). A real world example may help. Let’s say we have a product called AlphaBoogerBear. AlphaBoogerBear is a product, not a version (think pre-release Windows names). AlphaBoogerBear can be made into a Label, AlphaBoogerBearLabel. We perform a release of AlphaBoogerBear. There are some bugs. We fix them.

Now, we go back and edit AlphaBoogerBearLabel to include the bugfixes. The label no longer represents a snapshot at a point in time. Instead, it represents the most stable release of AlphaBoogerBear.

Finally, we move to BetaBoogerBear. We have the option to go back and grab a label that represents the old product at its best version in time.

In my opinion, if one requires a snapshot of version of source control it's better to branch. If one requires an edit-able snapshot that represents a product release then a Label is useful. Albeit, it seems a difficult balance of trust and convenience.

As far as the author's intentions, I really can't say for sure. He could mean to say that items can be deleted from a label and thus when you Get by Label the item will be gone. Though, the item is still stored in TFS history so although it is a confusing situation, not all is lost.

like image 113
P.Brian.Mackey Avatar answered Nov 09 '22 12:11

P.Brian.Mackey


I'm not sure what is meant by the sentence about labels getting affected by file deletions. But you have it right, a regular file delete won't affect labels, but a destroy will.

What it's cautioning you about with respect to not being version controlled though, is that somebody can come and edit a label, by including or excluding files from the label, or changing the versions of files included in the label. And there will be no history of these changes to the label definition.

like image 35
Dylan Smith Avatar answered Nov 09 '22 13:11

Dylan Smith