Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-tfs: A shelved pending change on a file is required

Tags:

git

tfs

git-tfs

I'm trying out git-tfs, and I'm trying to unshelve a shelveset by running the following:

git tfs unshelve "Shelveset Name" shelf

I'm getting the following error:

A shelved pending change on a file is required: $/path/to/dir/deleted

"deleted" is a directory that was deleted in the shelveset.

I'm only just starting with git-tfs. I need to checkin that shelveset, so for the time being I can do it with TFS alone, but if possible I'd like to know what might be going on and avoid it if possible.

Thanks for any help.

like image 917
Andrew Avatar asked Mar 24 '13 14:03

Andrew


People also ask

What is shelve pending changes in TFS?

Shelving is temporarily storing pending changes you have not committed yet. This is useful, for example, if you need to switch to another task, and you want to set your changes aside to work on them later.

How do I get TFS shelved code?

If you click on the branch/folder in Source Control Explorer, right click, go to Find, then click Find Shelvesets as you do to see them, and then when you find the shelveset you want to look at, right click on it in your team explorer window and choose "Unshelve".

What is shelve and Unshelve in TFS?

Unshelving is how you restore the shelveset to your machine so you can keep working on it. It doesn't change the shelveset on the server (to do that you need to shelve things again and use the same shelveset name).

How do you Unshelve a Shelveset in Visual Studio?

To unshelve the shelveset from someone else you go to Team Explorer -> Pending Changes. You then select the Action link next to Shelve and select Find Shelvesets. By default, you'll now see the shelvesets that are found for your user account.


1 Answers

This error message is not one of git-tfs but one of TFS (I just looked at the source code).

I just don't remember exactly how git-tfs manage shelveset because since I switch to git-tfs I never used this feature again. Mostly due to the fact that shelvesets are very badly designed :( And I think that your problem come from that design problem!

With a shelveset, which is in fact a bunch off file diff, you never know what is the root changeset from where it was "generated". So, if you try to unshelve it quite later, you've got some problems (like the one I think you have) because some files or folders were renamed or removed!

I think that your problem come from the fact that you try to unshelve with a checkouted git commit way too recent.

Try to checkout a commit approximately at the date of the shelveset and then unshelve! If it works, you should just have to rebase your commit on your branch (hoping that git handle better the renaming, which it did most of the time).

If it doesn't work, I don't know...

And Internet doesn't help us with this TFS error message :(

edit: since then, I think that git-tfs has been improved and perhaps it unshelve to the right parent commit.

edit2: before investigating too much, use the --force flag that could solve some edge cases

like image 147
Philippe Avatar answered Oct 12 '22 23:10

Philippe