Re: stash refuses to pop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/11/2012 1:58 AM, Johannes Sixt wrote:
You are trying to abuse git-stash, but it does not cooperate because it
was not designed to be abused ;-) git-stash is not intended as a generic
push-and-pop-my-changes work horse.

In what way is using the documented -p switch abuse?

The purpose of git-stash is that you can "move away"

Yes, and then move back. That is why it is broken that you can not immediately move back after a stash -p.

- all of your changes to have a clean worktree or
- part of your changes to _create a clean worktree from the remaining
changes_.

That is, before you can think of applying a stash, you are expected to
have cleaned out your worktree.

It is obvious that is the assumption that stash was originally made with, and it might make some sense if it always left the tree in a clean state, but it no longer makes sense given -p and how it can leave the tree in a not clean state.

This is clearly a case of the initial implementation being a bit lazy. pop already performs a type of merge, just on a whole file basis. In other words, the pop leaves you with some files from before the pop, and some files that were modified by the pop. It should do a proper merge instead of a lazy whole file merge.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]