Re: Removing an individual stashed state

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

 



El 11/9/2007, a las 0:30, David Kastrup escribió:

Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:

I do not understand your fixation on actively wanting to get rid of
that stash.  Why not just keep it, and be done with it?  It's not
like it hurts, or eats little children.

It's the equivalent of not moving done work from the "IN" pile.  At
some point of time you don't remember which of the stashes you already
did fold back, and which you didn't.

Exactly. Although I don't mind having to explicitly clear out the stashes every now and again when they start to pile up, but there is a definite usability issue once the list starts to grow beyond about 5 or 10 elements, and it can easily grow much larger depending on how heavily you use it. For this reason alone I think it would be helpful for Git to provide a convenient way of deleting specific stashes.

I understand that keeping stashes around after applying them is erring on the conservative side (not destroying information unless explicitly instructed to do so), but then, I'm hard pressed to think of a use case in which you'd want to apply the same stash more than once... can anyone think of an example? I guess you could conceivably change your mind, reset and make some more changes before reapplying the stash.

So it is quite natural to expect a stash to be gone after applying it.
The first surprise is that it is still there.

I too experienced this surprise. My initial expectation was that stashes were like stacks; that "git stash save" was like pushing onto the top of the stack and "git stash apply" was like popping an item off the stack. After thinking about it I guess I don't mind that it accumulates stashes the way it does, but I still think the lack of ability to target specific stashes for deletion is a whole in the feature set.

If a configuration variable or additional switch were to be provided for auto-deleting a stash after applying it, I doubt I'd use it, but I can imagine that many others would.

And the second surprise, sure to follow, is that trying to remove a
single stash, by any command that _starts_ with git-stash clear (even
if followed explicitly by a stash specification) will remove _all_
stashes.

Well, "clear" to me does have connotations of wide-scale elimination, unlike "delete" which would be more specific. At least for me for maximum usability the syntax would be:

- "git stash delete" to delete the most recently-added stash

- "git stash delete <stash>" to delete a specific stash

- and "git stash delete --all" (rather than "git stash clear") to clear out all stashes

But yes, it was surprising to me to discover that there was no obvious way of eliminating a single stash.

Cheers,
Wincent

-
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]

  Powered by Linux