All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: jpinheiro <7jpinheiro@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: cd
Date: Thu, 04 Apr 2013 00:55:49 +0200	[thread overview]
Message-ID: <515CB375.9010104@op5.se> (raw)
In-Reply-To: <1365000547327-7581484.post@n2.nabble.com>

On 04/03/2013 04:49 PM, jpinheiro wrote:
> Hi all,
>
> We are students from Universidade do Minho in Portugal, and we are using git
> in project as a case study.
> While experimenting with git we found an unexpected behavior with git rm.
> Here is a trace of the unexpected behavior:
>
> $ git init
> $ mkdir D
> $ echo "Hi" > D/F
> $ git add D/F
> $ rm -r D
> $ echo "Hey" > D
> $ git rm D/F
> warning: 'D/F': Not a directory
> rm 'D/F'
> fatal: git rm: 'D/F': Not a directory
>
>
> If the file D created with last echo did not exist or was named differently
> then no error would occur as expected. For example:
>
> $ git init
> $ mkdir D
> $ echo "Hi" > D/F
> $ git add D/F
> $ rm -r D
> $ echo "Hey" > F
> $ git rm D/F
>
> This works as expected, and the only difference is the name of the file of
> the last echo.
> Is this the expected behavior of git rm?
>

Yes. The only difference between 'git rm' and 'rm' is that git rm also
removes the file from its index and prepares to commit a version without
it. From git's point of view, it's not an error if the file doesn't
exist. It *is* an error if the directory where the file should reside
suddenly no longer a directory though.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

  reply	other threads:[~2013-04-03 22:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 14:49 cd jpinheiro
2013-04-03 22:55 ` Andreas Ericsson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-04 15:55 memory problem with fec on 8250 Samo Pogacnik
2004-01-05  8:15 ` Wojciech Kromer
2004-01-05 22:52   ` Samo Pogacnik
2004-01-06  7:47     ` cd Wojciech Kromer

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=515CB375.9010104@op5.se \
    --to=ae@op5.se \
    --cc=7jpinheiro@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 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.