git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: grizlyk <grizlyk1@yandex.ru>
Cc: git@vger.kernel.org
Subject: Re: Pro Git book: concerning data lost due to ".gitignore"
Date: Sat, 10 Jul 2021 10:23:25 +0200	[thread overview]
Message-ID: <87zguu4li5.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <4458411625892760@myt6-ab88f6e23eb0.qloud-c.yandex.net>


On Sat, Jul 10 2021, grizlyk wrote:

> hi
>
>> On Sat, Jun 05 2021
>> It's way too common of a pattern to e.g. have a *.o file made from a
>> corresponding *.[ch] file(s) in the same directory.
>
> The patterns were common for old times (before VCSes was involved). To
> deal with temporary files (like .o), generic OS tools like "make
> remove_compiled" can help to clean directory before stage. To keep
> derivative persistent files (like the same .o) separated directory can
> be used.

It's still a very common pattern, e.g. the project whose ML you're
posting to uses it, anecdotally most free software C or C-like projects
I look at / work on use it.

In any case, git as a project can't say "you should fix your code". This
VCS has to deal with the real world, people do use this pattern in the
wild, and we can't willy-nilly eat their data.

It's not a good approach to advocate a change in git behavior to say
"people should do X, not Y, to avoid this problem", when a cursory look
at real-world use reveals that "X" is in wide use, and unless you did
"Y" a proposed change in behavior would be detrimental to your use of
git.

What is more productive is to either find out how we can support both
without harming the other, or make new behavior opt-in, hence the
thread(s) I linked to about "precious" etc.

>> git already does a good job of supporting it. 
>
> Sure, the light message: "There are ignored files (%u<number of
> files>) not placed into repo.\n\t(use git status --ignored to view)";
> will improve the activity. Otherwise some files somethimes will not be
> placed into repo unexpectedly for user.
>
>> You'd e.g. compile all your 
>> assets outside of the repo via your build system, and just not have
>> anything in .gitignore.
>
> Do you suggest to copy desired src files into separated repo directory
> (the repo directory placed under VCS control) by generic OS tools
> (i.e. by cp command) and stage the separated directory?

I'm not really being serious here, as should be clear from the linked
threads I think the current behavior has sucky edge cases and does eat
people's data in some cases, that's bad, the problem is finding a way to
change it that doesn't cause badness for other use-cases.

I am saying that if your proposed "Y" solution is effectively "other
people should mostly/entirely rewrite their build systems to deal with a
new default I'm proposing", then in this case you'd also approximately
what you wou want if we keep the current behavior and you rewrite your
build system(s), no?

Anyway, maybe I misunderstood some of what you're saying...

      reply	other threads:[~2021-07-10  8:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 23:12 Pro Git book: concerning data lost due to ".gitignore" grizlyk
2021-06-05 20:39 ` Ævar Arnfjörð Bjarmason
2021-07-10  4:52   ` grizlyk
2021-07-10  8:23     ` Ævar Arnfjörð Bjarmason [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

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

  git send-email \
    --in-reply-to=87zguu4li5.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=grizlyk1@yandex.ru \
    /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).