From: Jakub Narebski <jnareb@gmail.com>
To: llucianf <llucianf@gmail.com>
Cc: git@vger.kernel.org, Ferry Huberts <mailings@hupie.com>
Subject: Re: gitignore design
Date: Fri, 29 Jul 2011 05:19:51 -0700 (PDT) [thread overview]
Message-ID: <m339hps2is.fsf@localhost.localdomain> (raw)
In-Reply-To: <1311940877783-6633274.post@n2.nabble.com>
llucianf <llucianf@gmail.com> writes:
> Ferry Huberts <mailings@hupie.com> writes:
> > On 07/29/2011 12:20 PM, llucianf wrote:
> > > why gitignore doesnt simply work like in cvs where if you put something in
> > > the ignore file, those stuff are simply ignored from that point without
> > > having to remove them from repo?
Are you sure that cvsignore file makes CVS to ignore changes in
_tracked_ files (in repository)? CVS manual says:
Ignoring files via cvsignore
============================
There are certain file names that frequently occur inside your
working copy, but that you don't want to put under CVS control.
Examples are all the object files that you get while you compile your
sources. Normally, when you run `cvs update', it prints a line for
each file it encounters that it doesn't know about.
Tracked files (in repository) are by definition not unknown to version
control system, be it CVS or Git.
> > because when it's in the repo you obviously want to track it...
> > tracking trumps ignoring
> >
> > if you now suddenly do not want to track it anymore you have to remove
> > it and ignore it.
>
> sorry but this is not always the case.
But it is _usually_ the case, and that is why gitignore works as it
does, being only about _untracked_ files.
> there are plenty of cases (project
> files is most common example) in which i need files in repo but i do not
> need git to track them. so why i cant just simply enumerate those project
> files into .gitignore and 'persuade' git to simply forget about them?
For that you can use 'assume-unachanged' mechanism (note: it is local
to repository). The gitignore(7) manpage says:
NOTES
The purpose of gitignore files is to ensure that certain files not tracked
by git remain untracked.
To ignore uncommitted changes in a file that is already tracked, use
`git update-index --assume-unchanged <file>`.
Or just don't use 'git commit -a' and commit with dirty tree.
--
Jakub Narębski
next prev parent reply other threads:[~2011-07-29 12:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 10:20 gitignore design llucianf
2011-07-29 11:51 ` Ferry Huberts
2011-07-29 12:01 ` llucianf
2011-07-29 12:08 ` Ferry Huberts
2011-07-29 12:16 ` llucianf
2011-07-29 12:27 ` Jakub Narebski
2011-07-29 12:44 ` llucianf
2011-07-29 12:57 ` Jakub Narebski
2011-07-29 14:01 ` Ferry Huberts
2011-07-29 12:19 ` Jakub Narebski [this message]
2011-07-29 12:58 ` Johannes Sixt
2011-07-29 13:19 ` Jakub Narebski
2011-07-29 13:31 ` Johannes Sixt
2011-07-29 21:39 ` Jakub Narebski
2011-07-30 3:10 ` Nguyen Thai Ngoc Duy
2011-07-30 6:45 ` Piotr Krukowiecki
2011-07-30 13:22 ` Nguyen Thai Ngoc Duy
2011-07-30 15:52 ` Piotr Krukowiecki
2011-07-30 16:01 ` Clemens Buchacher
2011-07-29 16:44 ` Philip Oakley
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=m339hps2is.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=llucianf@gmail.com \
--cc=mailings@hupie.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).