From: Junio C Hamano <gitster@pobox.com>
To: Rupinderjeet Singh <rupinderjeet47@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [suggestion] Fail cherry-pick if it overwrites untracked files with the matching file names
Date: Sun, 16 Oct 2022 10:08:18 -0700 [thread overview]
Message-ID: <xmqqk04z4ry5.fsf@gitster.g> (raw)
In-Reply-To: <CAAheMRy+B=2tBX-Frq5-NkdQFSm4jZHhEBVTReMwfGcvHVMQgQ@mail.gmail.com> (Rupinderjeet Singh's message of "Sun, 16 Oct 2022 00:39:44 +0530")
Rupinderjeet Singh <rupinderjeet47@gmail.com> writes:
> Yes, thank you for being so through with the example. I understand now.
>
> I want to ask if you would suggest that local configuration (or any
> information required by the project) that is too sensitive to be
> tracked in git, should either be kept as 'untracked' files or 'outside
> of git repository'.
I think it depends on the project and participants may not have
control over it if it is ingrained in the project's build structure,
but a separate place may likely be more appropriate, as it would
reduce the chance of accidental "git add ." adding everything.
> With your explanation, am I correct to think that only the following
> kind of information is suitable to be put in .gitignore files?
> 1. that can be regenerated
Yes.
> 2. that doesn't matter when it is lost
Natural consequence of the above
> 3. that isn't used by the files tracked in git repository
I do not get this, so I decline to comment ;) Is mylib.o that is
"ignored", created from tracked mylib.c source, used by mymain.c
source that is tracked, when mymain.o would not link without what
mylib.o gives it?
Some other SCMs have an extra class "precious" to handle exactly the
case you have in mind. You do not accidentally let "git add ." to
slurp them into the committed history, but you do want them to be
left alone. We don't have it, and that is not because we have any
reason to be against having it. It is just it didn't happen.
And nobody bothered to explore the ramification of adding the new
class yet. We know about "checkout" and other mergy operations and
"add", but there probably are trickier interactions with other parts
of the existing system that somebody need to carefully go through
and make sure it does not introduce funny inconsistencies.
next prev parent reply other threads:[~2022-10-16 17:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-15 18:09 [suggestion] Fail cherry-pick if it overwrites untracked files with the matching file names Rupinderjeet Singh
2022-10-15 18:33 ` Junio C Hamano
2022-10-15 18:35 ` Junio C Hamano
2022-10-15 19:09 ` Rupinderjeet Singh
2022-10-16 17:08 ` Junio C Hamano [this message]
2022-10-16 2:07 ` Elijah Newren
2022-10-16 16:57 ` Junio C Hamano
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=xmqqk04z4ry5.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=rupinderjeet47@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).