All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@ubuntu.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: stash refuses to pop
Date: Wed, 11 Apr 2012 10:21:07 -0400	[thread overview]
Message-ID: <4F859353.4070700@ubuntu.com> (raw)
In-Reply-To: <4F851D8A.4000501@viscovery.net>

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.

  reply	other threads:[~2012-04-11 14:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 17:52 stash refuses to pop Phillip Susi
2012-04-10 18:05 ` Junio C Hamano
2012-04-10 18:56   ` Phillip Susi
2012-04-11  2:47     ` Andrew Ardill
2012-04-11  2:59       ` Phillip Susi
2012-04-14  4:27         ` Andreas Krey
2012-04-14 10:12           ` Jakub Narebski
2012-04-16  1:29           ` Phillip Susi
2012-04-11  7:15       ` Victor Engmark
2012-04-11  5:58     ` Johannes Sixt
2012-04-11 14:21       ` Phillip Susi [this message]
2012-04-12  5:50         ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F859353.4070700@ubuntu.com \
    --to=psusi@ubuntu.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.