git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Виталий Бормотов" <bormvit@mail.ru>
Cc: git <git@vger.kernel.org>
Subject: Re: git probably bug
Date: Thu, 26 Feb 2015 13:36:11 -0800	[thread overview]
Message-ID: <xmqqegpcl5is.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1424979584.784776482@f205.i.mail.ru> ("Виталий	Бормотов"'s message of "Thu, 26 Feb 2015 22:39:44 +0300")

Виталий Бормотов  <bormvit@mail.ru> writes:

> When checking out into some different
> state, if there is no permissions to unlink files (if some files in
> the current state doesn't exist in the new) warnings are outputing,
> but then git says that checking out is successful, shows that we are
> in the new state and the non-unlinked files are marked as
> untracked.

This is done by reasonably old part of the codebase, and I think it
is exactly working as designed.  Unlinking of an existing path in
the filesystem is done for one of the two reasons:

 - The old tree has the path, the new tree does not.

 - The old tree has the path, the new tree has it but with a
   different content.

In both cases, we first attempt to unlink (and warn if we cannot)
and then attempt to create the path with the new contents in the
latter case (and die if we cannot).

The checkout itself succeeds, because having untracked cruft in your
working tree is not an error, but warnings are given to let you know
that you may want to remove them after fixing the screwy permission
problem yourself.

      reply	other threads:[~2015-02-26 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 19:39 git probably bug Виталий Бормотов
2015-02-26 21:36 ` Junio C Hamano [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=xmqqegpcl5is.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=bormvit@mail.ru \
    --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).