Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2022 15:50:39 +0100
From:      Kristof Provost <kp@FreeBSD.org>
To:        Drew Gallatin <gallatin@netflix.com>
Cc:        Andrew Gallatin <gallatin@cs.duke.edu>, "Alexander V. Chernikov" <melifaro@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Conrad Meyer <cem@freebsd.org>, Andriy Gapon <avg@freebsd.org>
Subject:   Re: git: b1f7154cb125 - main - gitignore: ignore vim swap files & .rej/.orig
Message-ID:  <6CFFB341-C17E-427D-99B8-E640505B83CB@FreeBSD.org>
In-Reply-To: <CADLQ3sKdAvci47RxK=Vqg4JA0Wff2z9dcuDrByWNdendQu=M%2Bw@mail.gmail.com>
References:  <202201170935.20H9ZM3T069547@gitrepo.freebsd.org> <72061959-88f8-d2ee-b4e9-f09ca084411e@cs.duke.edu> <4FC1EDC4-9F20-4271-B468-715A1727AC8A@FreeBSD.org> <CADLQ3sKdAvci47RxK=Vqg4JA0Wff2z9dcuDrByWNdendQu=M%2Bw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On 11 Feb 2022, at 15:38, Drew Gallatin wrote:
> The problem seems to be that all of these solutions are processed 
> *FIRST*,
> before a .gitignore in the repo, so they cannot be used to negate a
> gitignore rule in the repo.  Eg:
>
The man page claims this:

     When deciding whether
     to ignore a path, Git normally checks gitignore patterns from 
multiple
     sources, with the following order of precedence, from highest to 
lowest
     (within one level of precedence, the last matching pattern decides 
the
     outcome):

And then lists command line, .gitignore file in the same directory as 
the path, or in any parent directory, GIT_DIR/info/exclude and 
core.excludesFile.

So it’s does check them in the order you’d expect, but apparently 
does not let GIT_DIR/info/exclude overrule .gitignore. That’s a bit 
unfortunate. I’d really have expected a ‘!*.orig’ in 
GIT_DIR/info/exclude to overrule the .gitignore, but I’ve also tested 
it and it doesn’t.

> This makes a stronger case that those who want to ignore .orig and 
> .rej
> files can add them to *their* local .gitignore, and we should back 
> them out
> of the .gitignore for the project.
>
I don’t really like it (for the usual reasons: .orig & friends should 
pretty much never get checked in, so .gitignore is appropriate. Your 
workflow is a bit unusual, so ideally you’d do the special thing.), 
but yeah, it looks like we should indeed remove them from .gitignore in 
the repo.

Kristof

[-- Attachment #2 --]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body><div style="font-family: sans-serif;"><div class="markdown" style="white-space: normal;">
<p dir="auto">On 11 Feb 2022, at 15:38, Drew Gallatin wrote:</p>
</div><div class="plaintext" style="white-space: normal;"><blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136BCE; color: #136BCE;"><p dir="auto">The problem seems to be that all of these solutions are processed *FIRST*,
<br>
before a .gitignore in the repo, so they cannot be used to negate a
<br>
gitignore rule in the repo.  Eg:</p>
<br></blockquote></div>
<div class="markdown" style="white-space: normal;">
<p dir="auto">The man page claims this:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; border: thin solid gray; overflow-x: auto; max-width: 90vw; background-color: #E4E4E4;"><code>When deciding whether
to ignore a path, Git normally checks gitignore patterns from multiple
sources, with the following order of precedence, from highest to lowest
(within one level of precedence, the last matching pattern decides the
outcome):
</code></pre>
<p dir="auto">And then lists command line, .gitignore file in the same directory as the path, or in any parent directory, GIT_DIR/info/exclude and core.excludesFile.</p>
<p dir="auto">So it’s does check them in the order you’d expect, but apparently does not let GIT_DIR/info/exclude overrule .gitignore. That’s a bit unfortunate. I’d really have expected a ‘!*.orig’ in GIT_DIR/info/exclude to overrule the .gitignore, but I’ve also tested it and it doesn’t.</p>
</div><div class="plaintext" style="white-space: normal;"><blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136BCE; color: #136BCE;"><p dir="auto">This makes a stronger case that those who want to ignore .orig and .rej
<br>
files can add them to *their* local .gitignore, and we should back them out
<br>
of the .gitignore for the project.</p>
<br></blockquote></div>
<div class="markdown" style="white-space: normal;">
<p dir="auto">I don’t really like it (for the usual reasons: .orig &amp; friends should pretty much never get checked in, so .gitignore is appropriate. Your workflow is a bit unusual, so ideally you’d do the special thing.), but yeah, it looks like we should indeed remove them from .gitignore in the repo.</p>
<p dir="auto">Kristof</p>

</div></div></body>

</html>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6CFFB341-C17E-427D-99B8-E640505B83CB>