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
--=_MailMate_DE4680ED-4562-4D6E-882A-8C0E25C4755B_= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 --=_MailMate_DE4680ED-4562-4D6E-882A-8C0E25C4755B_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/xhtml; charset=3Dutf-8"= > </head> <body><div style=3D"font-family: sans-serif;"><div class=3D"markdown" sty= le=3D"white-space: normal;"> <p dir=3D"auto">On 11 Feb 2022, at 15:38, Drew Gallatin wrote:</p> </div><div class=3D"plaintext" style=3D"white-space: normal;"><blockquote= style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136= BCE; color: #136BCE;"><p dir=3D"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=3D"markdown" style=3D"white-space: normal;"> <p dir=3D"auto">The man page claims this:</p> <pre style=3D"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=3D"auto">And then lists command line, .gitignore file in the same = directory as the path, or in any parent directory, GIT_DIR/info/exclude a= nd core.excludesFile.</p> <p dir=3D"auto">So it=E2=80=99s does check them in the order you=E2=80=99= d expect, but apparently does not let GIT_DIR/info/exclude overrule .giti= gnore. That=E2=80=99s a bit unfortunate. I=E2=80=99d really have expected= a =E2=80=98!*.orig=E2=80=99 in GIT_DIR/info/exclude to overrule the .git= ignore, but I=E2=80=99ve also tested it and it doesn=E2=80=99t.</p> </div><div class=3D"plaintext" style=3D"white-space: normal;"><blockquote= style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136= BCE; color: #136BCE;"><p dir=3D"auto">This makes a stronger case that tho= se who want to ignore .orig and .rej <br> files can add them to *their* local .gitignore, and we should back them o= ut <br> of the .gitignore for the project.</p> <br></blockquote></div> <div class=3D"markdown" style=3D"white-space: normal;"> <p dir=3D"auto">I don=E2=80=99t really like it (for the usual reasons: .o= rig & friends should pretty much never get checked in, so .gitignore = is appropriate. Your workflow is a bit unusual, so ideally you=E2=80=99d = do the special thing.), but yeah, it looks like we should indeed remove t= hem from .gitignore in the repo.</p> <p dir=3D"auto">Kristof</p> </div></div></body> </html> --=_MailMate_DE4680ED-4562-4D6E-882A-8C0E25C4755B_=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6CFFB341-C17E-427D-99B8-E640505B83CB>