From nobody Fri Feb 11 14:38:24 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9F8A919A8157 for ; Fri, 11 Feb 2022 14:38:38 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JwGSs4wKWz4fGl for ; Fri, 11 Feb 2022 14:38:37 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: by mail-ed1-x52a.google.com with SMTP id bx2so16775910edb.11 for ; Fri, 11 Feb 2022 06:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LjqiaNxKL5ZygnxE+lcy7bdmnPy+zn0HlgMd5utbBdU=; b=XP5QVZQ9D92bUSf6ucmgoOeOc7gbxV3MYD6/5pBozyQaITypLKjO0TjG79COASvtsJ gv91AOQvUYnqoFS/TNR2Y48gVg/gfP2DEs2njCc1fMYGVOmUjXUmw8xMdQjpuq0nxq6C CbpaotY2FeLK7lfTunHmZYJPOGt4PmhJDim4A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LjqiaNxKL5ZygnxE+lcy7bdmnPy+zn0HlgMd5utbBdU=; b=fk83Ta9rbD/CHgswhT0Idz0cnAsPXo2kdX2SeV9MiDv+h9ADpvGGJGt3yiugRGf7gz aqYYpuaxzEV/B+P/Nt4Sr61FpnOhPIvpg8QBWhNGy/rvc377Nsy9SYxrIoDgBSxy3lFU i6IEWZbsWUd9LLx1kNEgJ7o2zYcjjTD0uLGgYVFi7mKCMzADUhMgo9yrwADEDIM7FgJf ep7liFSHDXCO6bhkkKy0YWh6huoqmdRlYCW11r6k8+rrRG0hgC2t4BpMVGDlRz13Q1UI 2rO0r+HN0bZ4GEyCOAsY8d+9lq0qRBt0J70jPCtyiRHYTWXP9INmvhFvZfNf5siaIwH+ 0HxA== X-Gm-Message-State: AOAM531IwUuNoTJcR3YRx6Hy8G70FCGD2kYoTtLonpgDVJuXvLuxndvE Te/2mfqACYxk4vnpqi3YXeljmBNcOIHvXmBFWT2C X-Google-Smtp-Source: ABdhPJy0Z52woOpkNM1dfo5+xrqG+wlmrIcBbWGHBLiE2CB+50mqQK8W7uZB0u4cvAp6kc+WFCzYhu9F5UPsXoFIUA4= X-Received: by 2002:aa7:dc05:: with SMTP id b5mr2291876edu.197.1644590316580; Fri, 11 Feb 2022 06:38:36 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202201170935.20H9ZM3T069547@gitrepo.freebsd.org> <72061959-88f8-d2ee-b4e9-f09ca084411e@cs.duke.edu> <4FC1EDC4-9F20-4271-B468-715A1727AC8A@FreeBSD.org> In-Reply-To: <4FC1EDC4-9F20-4271-B468-715A1727AC8A@FreeBSD.org> From: Drew Gallatin Date: Fri, 11 Feb 2022 09:38:24 -0500 Message-ID: Subject: Re: git: b1f7154cb125 - main - gitignore: ignore vim swap files & .rej/.orig To: Kristof Provost Cc: Andrew Gallatin , "Alexander V. Chernikov" , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Conrad Meyer , Andriy Gapon Content-Type: multipart/alternative; boundary="0000000000009f70e405d7bf0547" X-Rspamd-Queue-Id: 4JwGSs4wKWz4fGl X-Spamd-Bar: ------------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netflix.com header.s=google header.b=XP5QVZQ9; dmarc=pass (policy=reject) header.from=netflix.com; spf=pass (mx1.freebsd.org: domain of gallatin@netflix.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=gallatin@netflix.com X-Spamd-Result: default: False [-13.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; FREEFALL_USER(0.00)[gallatin]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52a:from]; MLMMJ_DEST(0.00)[dev-commits-src-main]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; NEURAL_HAM_SHORT(-0.99)[-0.992]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] X-ThisMailContainsUnwantedMimeParts: N --0000000000009f70e405d7bf0547 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 11, 2022 at 4:38 AM Kristof Provost wrote: > On 11 Feb 2022, at 2:25, Andrew Gallatin wrote: > > On 1/17/22 04:35, Alexander V. Chernikov wrote: > > The branch main has been updated by melifaro: > > URL: > https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=3Db1f= 7154cb12517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_aNhw= m1heXl1CyQyb0N5f_fiBJEkTQGhLzE7KlqqP9C7A$ > > commit b1f7154cb12517162a51d19ae19ec3f2dee88e11 > Author: Alexander V. Chernikov > AuthorDate: 2022-01-08 16:14:47 +0000 > Commit: Alexander V. Chernikov > CommitDate: 2022-01-17 09:35:15 +0000 > > gitignore: ignore vim swap files & .rej/.orig > Reviewed by: cem, avg > MFC after: 2 weeks > > Hi, > > I was wondering if you might consider reverting this change? > Alternatively, can you teach me how to override this file > locally without carrying a diff? > > I'm asking because this makes life painful for my workflow. > > Having git clean be able to handle .orig and .rej is incredibly > handy when applying large patch sets. It makes finding a rejected > patch as simple as 'git clean -n | grep rej'. > > Would =E2=80=98git clean -n -x=E2=80=99 work for you? > > -x > Don=E2=80=99t use the standard ignore rules (see gitignore(5)), bu= t still use > the ignore rules given with -e options from the command line. This > allows removing all untracked files, including build products. Thi= s > can be used (possibly in conjunction with git restore or git reset= ) > to create a pristine working directory to test a clean build. > > Yes, except it would delete our .obj directories, which I don't want. The -x is how I figured out the .gitignore had been changed. > Alternatively, the gitignore(5) man page also mentions that patterns can > be listed in > > =E2=80=A2 Patterns read from $GIT_DIR/info/exclude. > > =E2=80=A2 Patterns read from the file specified by the configuration= variable > core.excludesFile. > > So I=E2=80=99d think you can overrule things you don=E2=80=99t like from = the repo > gitignore file in $GIT_DIR/info/exclude or in your global git > configuration, especially combined with this: > > =E2=80=A2 An optional prefix "!" which negates the pattern; any matc= hing file > excluded by a previous pattern will become included again. It is n= ot > possible to re-include a file if a parent directory of that file i= s > excluded. Git doesn=E2=80=99t list excluded directories for perfor= mance > reasons, so any patterns on contained files have no effect, no mat= ter > where they are defined. Put a backslash ("\") in front of the firs= t > "!" for patterns that begin with a literal "!", for example, > "\!important!.txt". > > Kristof > 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: <9:32am>beast/gallatin:work1>kdump | grep NAMI | egrep exclude\|gitignore | head 42947 git NAMI "/home/gallatin/.gitignore" 42947 git NAMI "/home/gallatin/.gitignore" 42947 git NAMI "/data/ocafirmware/.git/info/exclude" 42947 git NAMI "/data/ocafirmware/.git/info/exclude" 42947 git NAMI ".gitignore" 42947 git NAMI "FreeBSD/.gitignore" 9:34am>beast/gallatin:work1>cat ~/.gitignore !*.orig !*.rej <9:35am>beast/gallatin:work1>git clean -n | grep rej <9:35am>beast/gallatin:work1>git clean -xn | grep rej Would remove FreeBSD/sys/dev/mlx5/mlx5_en/en_hw_tls.h.rej 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. Drew --0000000000009f70e405d7bf0547 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Feb 11, 2022 at 4:38 AM Krist= of Provost <kp@freebsd.org> wro= te:

On 11 Feb 2022, at 2:25, Andrew Gallatin wrote:

On 1/17/22 04:35, Alexander V. Chernikov wrote:

The branch main = has been updated by melifaro:

URL: https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/co= mmit/?id=3Db1f7154cb12517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opx= re6qHuywX_aNhwm1heXl1CyQyb0N5f_fiBJEkTQGhLzE7KlqqP9C7A$

commit b1f7154cb12517162a51d19ae19ec3f2dee88e11
Author: Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2022-01-08 16:14:47 +0000
Commit: Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2022-01-17 09:35:15 +0000

gitignore: ignore vim swap files & .rej/.orig
Reviewed by: cem, avg
MFC after: 2 weeks

Hi,

I was wondering if you might consider reverting this change= ?
Alternatively, can you teach me how to override this file
locally without carrying a diff?

I'm asking because this makes life painful for my workf= low.

Having git clean be able to handle .orig and .rej is incred= ibly
handy when applying large patch sets. It makes finding a rejected
patch as simple as 'git clean -n | grep rej'.


Would =E2=80=98git clean -n -x=E2=80=99 work for you?

=
   -x
       Don=E2=80=99t use the standard ignore rules (see gitignore(5)), but =
still use
       the ignore rules given with -e options from the command line. This
       allows removing all untracked files, including build products. This
       can be used (possibly in conjunction with git restore or git reset)
       to create a pristine working directory to test a clean build.


Yes,= except it would delete our .obj directories, which I don't want.=C2=A0= The -x is how I figured out the .gitignore had been changed.
=C2=A0

Alternatively, the gitignore(5) man page also mentions that patterns = can be listed in

=
   =E2=80=A2   Patterns read from $GIT_DIR/info/exclude.

   =E2=80=A2   Patterns read from the file specified by the configuration v=
ariable
       core.excludesFile.

So I=E2=80=99d think you can overrule things you don=E2=80= =99t like from the repo gitignore file in $GIT_DIR/info/exclude or in your = global git configuration, especially combined with this:

=
   =E2=80=A2   An optional prefix "!" which negates the pat=
tern; any matching file
       excluded by a previous pattern will become included again. It is not
       possible to re-include a file if a parent directory of that file is
       excluded. Git doesn=E2=80=99t list excluded directories for performa=
nce
       reasons, so any patterns on contained files have no effect, no matte=
r
       where they are defined. Put a backslash ("\") in front of =
the first
       "!" for patterns that begin with a literal "!", =
for example,
       "\!important!.txt".

Kristof


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 giti= gnore rule in the repo.=C2=A0 Eg:

<9:32am>beast/gallatin:work1>kdump | grep NA= MI | egrep exclude\|gitignore | head
=C2=A042947 git =C2=A0 =C2=A0 =C2= =A0NAMI =C2=A0"/home/gallatin/.gitignore"
=C2=A042947 git =C2= =A0 =C2=A0 =C2=A0NAMI =C2=A0"/home/gallatin/.gitignore"
=C2=A0= 42947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/data/ocafirmware/.git/info/= exclude"
=C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/data= /ocafirmware/.git/info/exclude"
=C2=A042947 git =C2=A0 =C2=A0 =C2= =A0NAMI =C2=A0".gitignore"
=C2=A042947 git =C2=A0 =C2=A0 =C2= =A0NAMI =C2=A0"FreeBSD/.gitignore"

9:34am>beast/gallatin:work1>cat ~/.gitignore
!*.orig<= br>!*.rej

<9:35am>beast/gallatin:work1>git clean -n | grep = rej
<9:35am>beast/gallatin:work1>git clean -xn | grep rej
Wo= uld remove FreeBSD/sys/dev/mlx5/mlx5_en/en_hw_tls.h.rej


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.

= Drew
=C2=A0
--0000000000009f70e405d7bf0547--