git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quin Hoxie <qhoxie@gmail.com>
To: git@vger.kernel.org
Subject: Bug with mv + stash?
Date: Tue, 5 May 2009 11:47:22 -0700	[thread overview]
Message-ID: <6e699a4d0905051147m5c495d5erdb608203d0aa69be@mail.gmail.com> (raw)

This may or may not be considered a bug, given the empty file, but I
thought it would be prudent to report it just in case.
When moving/renaming a tracked file, and then creating a new file with
the original name, stash loses/deletes the new file.
Below is the full transaction to reproduce the behavior.

--
Quin Hoxie


[quin@qmbp /tmp] $ mkdir repo
[quin@qmbp /tmp] $ cd repo
[quin@qmbp /tmp/repo] $ git init
Initialized empty Git repository in /private/tmp/repo/.git/
[quin@qmbp /tmp/repo] $ echo "hello world" > foo
[quin@qmbp /tmp/repo] $ git add foo
[quin@qmbp /tmp/repo] $ git commit -m "added foo"
[master (root-commit)]: created 9ed55f1: "added foo"
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo
[quin@qmbp /tmp/repo] $ git mv foo bar
[quin@qmbp /tmp/repo] $ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       renamed:    foo -> bar
#
[quin@qmbp /tmp/repo] $ touch foo
[quin@qmbp /tmp/repo] $ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       renamed:    foo -> bar
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       foo
[quin@qmbp /tmp/repo] $ git stash
Saved working directory and index state "WIP on master: 9ed55f1... added foo"
HEAD is now at 9ed55f1 added foo
(To restore them type "git stash apply")
[quin@qmbp /tmp/repo] $ git stash apply
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   bar
#
# 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:    foo
#
[quin@qmbp /tmp/repo] $ ls
bar
[quin@qmbp /tmp/repo] $

                 reply	other threads:[~2009-05-05 18:47 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=6e699a4d0905051147m5c495d5erdb608203d0aa69be@mail.gmail.com \
    --to=qhoxie@gmail.com \
    --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).