Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tobias Preuss <tobias.preuss@googlemail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Bug report: Folder and files are deleted by git stash -u
Date: Thu, 05 Feb 2015 11:37:31 -0800	[thread overview]
Message-ID: <xmqqegq4kv44.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqvbjgkw4i.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Thu, 05 Feb 2015 11:15:41 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Tobias Preuss <tobias.preuss@googlemail.com> writes:
>
>> I noticed some bizarre behaviour when using: git stash -u.
>> It deletes folders which contain files configured to be ignored.
>
> The files you mark as ignored are expendable and this is not limited
> to "stash".
> ...
> Here is what should happen when you go to 'master':
>
>     $ git checkout master
>     Switched to branch 'master'
>     $ /bin/ls -AF
>     a  .git/  .gitignore
>
> That is, a/file.c that is safely stored in 'side' branch is removed,
> a/file.o that is expendable is deleted, and the empty directory 'a'
> now can be replaced with the regular file 'a' the 'master' branch
> wants to have.

Addendum 1.

    If *.o files are not treated expendable, you would be forced to
    "make clean" every time you switch between these two branches,
    which is unacceptable.

Addendum 2.

    There was an old wishlist item to introduce another class of
    paths (in addition to the "tracked", "untracked" and "ignored")
    that are "ignored-but-precious".  Then "*.o" would still be
    expendable while a directory that must become a regular file
    with "ignored-but-precious" files in it would prevent switching
    from branch 'side' to 'master' in the illustration in the
    previous message in order to keep that "ignored-but-precious"
    file.

    But nobody needed such a feature badly enough to step up and
    implement it.

    cf. http://article.gmane.org/gmane.comp.version-control.git/185746

      reply	other threads:[~2015-02-05 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05  9:56 Bug report: Folder and files are deleted by git stash -u Tobias Preuss
2015-02-05 19:15 ` Junio C Hamano
2015-02-05 19:37   ` 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=xmqqegq4kv44.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tobias.preuss@googlemail.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