git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [suggestion] Fail cherry-pick if it overwrites untracked files with the matching file names

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 16, 2022, 17:08 UTC
Message-ID
<xmqqk04z4ry5.fsf@gitster.g>
In-Reply-To
<CAAheMRy+B=2tBX-Frq5-NkdQFSm4jZHhEBVTReMwfGcvHVMQgQ@mail.gmail.com>
Rupinderjeet Singh <rupinderjeet47@gmail.com> writes:
Show 6 quoted lines
> 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.

Previous: Rupinderjeet SinghNext: Elijah Newren
Message 5 of 7 in “[suggestion] Fail cherry-pick if it overwrites untracked files with the matching file names”
  1. Rupinderjeet SinghOct 15, 2022
  2. Junio C HamanoOct 15, 2022
  3. Junio C HamanoOct 15, 2022
  4. Rupinderjeet SinghOct 15, 2022
  5. Junio C HamanoOct 16, 2022
  6. Elijah NewrenOct 16, 2022
  7. Junio C HamanoOct 16, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.