git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Visher <tim.visher@gmail.com>
To: Nanako Shiraishi <nanako3@lavabit.com>
Cc: git@vger.kernel.org
Subject: Re: Confusing `stash apply` behavior
Date: Wed, 11 Mar 2009 08:45:34 -0400	[thread overview]
Message-ID: <c115fd3c0903110545o67b00fe2u3bb4924b5c84c0ce@mail.gmail.com> (raw)
In-Reply-To: <20090311190217.6117@nanako3.lavabit.com>

On Wed, Mar 11, 2009 at 6:02 AM, Nanako Shiraishi <nanako3@lavabit.com> wrote:
> Quoting Tim Visher <tim.visher@gmail.com>:
>
>> When I do `git stash apply`, it deletes the file I'm working with.
>>
>>     $ ls
>>     featureList.txt*  keycontrol.mdb*
>>
>>     $ git show stash@{0}
>>     commit b3c0f4b9b3c3ef7741a03fb27174f5838abc939d
>>     Merge: 9fb9886 112bba9
>>     Author: Tim Visher <timothy.visher@fms.treas.gov>
>>     Date:   Tue Mar 10 15:25:04 2009 -0400
>>
>>     WIP on dev: 9fb9886 Added DB Lock file to .gitignore. EOM
>>
>>     diff --cc keycontrol.mdb
>>     index 68a9bac,68a9bac..0000000
>>     --- a/keycontrol.mdb
>>     +++ b/keycontrol.mdb
>>
>>     $ git stash apply
>>     Removing keycontrol.mdb
>>     # On branch refactoring
>>     # Changed but not updated:
>>     #   (use "git add/rm <file>..." to update what will be committed)
>>     #   (use "git checkout -- <file>..." to discard changes in working
>> directory)
>>     #
>>     #       deleted:    keycontrol.mdb
>>     #
>>     no changes added to commit (use "git add" and/or "git commit -a")
>>
>> Considering the output of `git show` I would expect that the contents
>> of the stash are, well, what I expect them to be: a new version of
>> keycontrol.mdb.
>
> The 'index' line in your 'diff --cc' output says that back when you created that stash, the HEAD and your index both held a blob object 68a9bac and your working tree didn't have that file, ie, removed. It is very natural that the file is removed when you apply that stash.

Huh.  I don't know how that would have happened, but I guess I should
have been more careful with the stash command.  Oh well.

Thanks for your help!

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

      reply	other threads:[~2009-03-11 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10 19:46 Confusing `stash apply` behavior Tim Visher
2009-03-11 10:02 ` Nanako Shiraishi
2009-03-11 12:45   ` Tim Visher [this message]

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=c115fd3c0903110545o67b00fe2u3bb4924b5c84c0ce@mail.gmail.com \
    --to=tim.visher@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=nanako3@lavabit.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).