git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Uwe Storbeck <uwe@ibr.ch>
To: git@vger.kernel.org
Subject: Asymmetric default behavior of git stash
Date: Tue, 27 Aug 2013 16:07:09 +0200	[thread overview]
Message-ID: <20130827132210.GA14266@ibr.ch> (raw)

Hi,

is there any reason why the default behavior of git stash is
asymmetric?

When I save my current state with 'git stash save' it saves the
worktree changes and the index changes (and resets both). When I
restore the state with 'git stash pop' it restores the worktree
changes, but not the state of the index. Your work preparing the
index is lost.

Although this behavior is documented it is kind of unexpected.
From a save-restore mechanism I would expect that the default
behavior would restore the state as it was before the save. So
I would expect it to either save and restore the worktree and
leave the index alone or save and restore both, the worktree
and the index.

Regards

Uwe

                 reply	other threads:[~2013-08-27 14:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20130827132210.GA14266@ibr.ch \
    --to=uwe@ibr.ch \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).