From: Chris Rorvick <chris@rorvick.com>
To: Matthew Ciancio <matthew.ciancio16@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Feature Request - Hide ignored files before checkout
Date: Sat, 8 Dec 2012 13:21:07 -0600 [thread overview]
Message-ID: <CAEUsAPaHJ+N0EnxGuVkRqcmY0fUy+4myMiWtd1_vu1vRL763JQ@mail.gmail.com> (raw)
In-Reply-To: <000301cdd4dd$f8554090$e8ffc1b0$@gmail.com>
On Fri, Dec 7, 2012 at 6:50 PM, Matthew Ciancio
<matthew.ciancio16@gmail.com> wrote:
> Imagine this scenario:
>
> 1) You have a Git repo with two branches (branchA and branchB), which are
> currently identical.
> 2) Checkout to branch.
> 3) Create file foo.txt, stage it and commit it.
> 4) Create file ignore.txt and add it to the ".gitignore" file of branchB so
> that it is successfully ignored by Git.
> 5) Checkout to branchA.
>
> Problem: ignore.txt does not "disappear" like foo.txt does
When you say "disappear", do you mean "deleted from the file system"
or something else?
> and is now just
> sitting in branchA (and now any other branch I checkout into).
It's not in branchA, it's just no longer ignored because your changes
to .gitignore were effectively reverted by jumping back to the commit
that branchA points to.
> When I first started using Git, I genuinely thought this was a bug, because
> it seems so logical to me that ignore files should hide/reappear just like
> tracked files do, when switching branches.
"hide/reappear" is the equivalent to saying "deleted/created" in the
case of a tracked file in your working tree. But how would Git cause
an untracked file to reappear? By definition, it doesn't know
anything about the file.
> P.S. Here is a forum post I made on StackOverflow about the issue:
> http://stackoverflow.com/questions/13761682/gitignore-hide-ignored-files-dur
> ing-checkout
I posted an answer there, too, but I'm not sure I fully understand the
problem. The top-voted answer doesn't make much sense, though.
Thanks,
Chris
next prev parent reply other threads:[~2012-12-08 19:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-08 0:50 Feature Request - Hide ignored files before checkout Matthew Ciancio
2012-12-08 19:21 ` Chris Rorvick [this message]
[not found] ` <000001cdd5a0$fd23adf0$f76b09d0$@gmail.com>
2012-12-09 5:54 ` Chris Rorvick
2012-12-09 8:10 ` Matthew Ciancio
2012-12-09 9:04 ` Junio C Hamano
2012-12-09 22:37 ` Matthew Ciancio
2012-12-10 1:46 ` Andrew Ardill
2012-12-10 2:01 ` Matthew Ciancio
2012-12-10 9:47 ` Erik Faye-Lund
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=CAEUsAPaHJ+N0EnxGuVkRqcmY0fUy+4myMiWtd1_vu1vRL763JQ@mail.gmail.com \
--to=chris@rorvick.com \
--cc=git@vger.kernel.org \
--cc=matthew.ciancio16@gmail.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).