From: "SZEDER Gábor" <szeder@ira.uka.de>
To: "Jonas Flodén" <jonas.floden@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Unexpected behaviour with git stash save --keep-index?
Date: Tue, 2 Sep 2008 03:28:04 +0200 [thread overview]
Message-ID: <20080902012804.GB6739@neumann> (raw)
In-Reply-To: <B1185033-36D7-4504-92A3-6F75B6CE90DF@gmail.com>
Hi,
On Tue, Sep 02, 2008 at 01:14:10AM +0200, Jonas Flodén wrote:
> while I was using StGit for the first time and used git stash to split
> the changes into different patches I noticed that git stash save --
> keep-index
> will stash also the changes that are already in the index. This was
> unexpected
> atleast to me but maybe someone can explain why it's correct.
A plain 'git stash [save]' means "save all local modifications and
clear both the index and the working tree".
'git stash save --keep-index' means "save all local modifications and
remove all modifications from the working tree that are not in the
index". This differs substantially from "save only those
modifications that are not in the index, and then remove them from the
working tree".
> Also maybe someone could someone recommend a way to split an unclean
> working dir
> into several patches/commits?
The workflow described at the end of stash's man page (under 'Testing
partial commits') works well for me.
(Heh, I have just looked that section up, and noticed that the
formatting is broken and some comments are missing from the man page.
I will send out a patch in a minute.)
Regards,
Gábor
next prev parent reply other threads:[~2008-09-02 1:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-01 23:14 Unexpected behaviour with git stash save --keep-index? Jonas Flodén
2008-09-02 1:28 ` SZEDER Gábor [this message]
2008-09-02 1:35 ` [PATCH] Documentation: fix disappeared lines in 'git stash' manpage SZEDER Gábor
2008-09-02 1:45 ` [PATCH] Documentation: minor cleanup in a use case in 'git stash' manual SZEDER Gábor
2008-09-02 6:20 ` Unexpected behaviour with git stash save --keep-index? Jonas Flodén
2008-09-02 7:45 ` Karl Hasselström
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=20080902012804.GB6739@neumann \
--to=szeder@ira.uka.de \
--cc=git@vger.kernel.org \
--cc=jonas.floden@gmail.com \
/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).