git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Jaydeep Das <jaydeepjd.8914@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: A new feature command request `cmd_ignore`
Date: Sat, 15 Jan 2022 16:38:08 +0100	[thread overview]
Message-ID: <9a7eac53-79fe-24f5-225a-d00d26e67259@kdbg.org> (raw)
In-Reply-To: <9a3837b4-8c67-e114-e977-f6c7b729ba45@gmail.com>

Am 15.01.22 um 11:45 schrieb Jaydeep Das:
> 
>> I think that is a paraphrase of the suggestion to
> 
>    git rm --cached settings
>    echo settings >> .gitignore
> 
>> when changes to a file 'settings' that was already tracked (and often
>> contains user-specific settings) should be ignored. This misguided and
>> short-sighted "solution" is repeated numerous times on Stackoverflow.
>> Not something that we should encourage.
> 
> So what should be done in this scenario? And why is it a discouraged and
> misguided thing?

It is misguided because if you commit the removal of 'settings', others
who pull/merge this change will either see their 'settings' be removed
(when they did not change the file) or their pull/merge will fail with
an error about a modified file being in the way (when they did modify
it). It causes a whole lot of grief for others.

There are different ways to address this problem.

- One is to commit a 'settings.template' file that must be copied to
'settings' and is adjusted as necessary, but not `git add`ed.

- Another is to have a mechanism that can include local files that carry
the user-specific settings.

- Yet another is to generate the final file from a tracked template and
a local, untracked, file during the build process.

-- Hannes

      reply	other threads:[~2022-01-15 15:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 18:58 A new feature command request `cmd_ignore` Jaydeep Das
2022-01-15  5:17 ` Elijah Newren
2022-01-15  9:03   ` Johannes Sixt
2022-01-15 10:45     ` Jaydeep Das
2022-01-15 15:38       ` Johannes Sixt [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a7eac53-79fe-24f5-225a-d00d26e67259@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git@vger.kernel.org \
    --cc=jaydeepjd.8914@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).