From nobody Fri Feb 11 15:02:05 2022 X-Original-To: dev-commits-src-all@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 DDBC719B8556 for ; Fri, 11 Feb 2022 15:02:18 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 4JwH0B0jgTz4pYF for ; Fri, 11 Feb 2022 15:02:18 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: by mail-ej1-x636.google.com with SMTP id h22so5423539ejl.12 for ; Fri, 11 Feb 2022 07:02:18 -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=L51Oxw54gXM+uL/36ZlaYibP1N2itRvUDmEl48oGRxs=; b=NIvjgfupvZjhYDpxN6XJUUsi9xSZMmM7qeye7qgi+3uLs8WLkYUg1mWwTyCHA6I0Lf 2Cwj4kloMAJODKaIftvENsMaRsAjvqgMCxT1U+lpVhLWbNVL5vaBlodzUwXE2vI/QlcJ 9r5vaIZAVVBtloHlRD9IcsqRcnm3jFouZvwDQ= 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=L51Oxw54gXM+uL/36ZlaYibP1N2itRvUDmEl48oGRxs=; b=0JvJADQzzJNu0kyI6ah+Bt3XIAvN31csdMVa7ed2nl/m/BSNF7fe6XdpfIxjjfrEw4 FHUv9qujSkvvD2EEBuknfDA7YASa4saHCYNAdDAJGorPkfh0G1ARRzVyy1tx/0dOcEMM hfDAaLctQAofVgQnIkFZjLKKclml/x4Vf3+nagYrXEA5jKMjVUIdwyGlPpYCw6M3D0Yb TlVIVBjlf6EeHYnMhYceQa7jglGd7tcXTn3xIpfkk4/lmcWzAGtFZPuZDHwboOckmP25 xy7xQElN16CFmRN8V/H/02KcwHhrKT68CJYrnnNK8SWAPRwaXB1K0iVBCH5InjDzc5jU RfKg== X-Gm-Message-State: AOAM530GrbO6Tp+D3ywWz3X9ImTFqVf1ebhykTlByTpl6ZFSjUWRr45V KFYiuiNhek+KK6U88ZCRdZWsQ7bKBAtz/cThI469 X-Google-Smtp-Source: ABdhPJxebO0TNd8qnExjz4Z0+evSRrNwmFLsQXFMRnpMQM7j5ijIN93oWs0BrsVdVgmczYMfpbY1JoHzOi8EFeUFEnw= X-Received: by 2002:a17:906:649c:: with SMTP id e28mr1728155ejm.324.1644591736968; Fri, 11 Feb 2022 07:02:16 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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> <4f4f6a83-3def-4938-6e40-5460486cc415@FreeBSD.org> In-Reply-To: <4f4f6a83-3def-4938-6e40-5460486cc415@FreeBSD.org> From: Drew Gallatin Date: Fri, 11 Feb 2022 10:02:05 -0500 Message-ID: Subject: Re: git: b1f7154cb125 - main - gitignore: ignore vim swap files & .rej/.orig To: Renato Botelho Cc: Kristof Provost , 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="00000000000048f23105d7bf5a33" X-Rspamd-Queue-Id: 4JwH0B0jgTz4pYF X-Spamd-Bar: ------------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netflix.com header.s=google header.b=NIvjgfup; dmarc=pass (policy=reject) header.from=netflix.com; spf=pass (mx1.freebsd.org: domain of gallatin@netflix.com designates 2a00:1450:4864:20::636 as permitted sender) smtp.mailfrom=gallatin@netflix.com X-Spamd-Result: default: False [-13.98 / 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-all@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)[9]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::636:from]; MLMMJ_DEST(0.00)[dev-commits-src-all]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; NEURAL_HAM_SHORT(-0.98)[-0.977]; 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 --00000000000048f23105d7bf5a33 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think that has the same problem. Either that, or I'm doing the escaping wrong. Using tcsh: <10:01am>beast/gallatin:work1>git clean -ne '\!\*.orig' Would remove ktrace.out <10:01am>beast/gallatin:work1>git clean -xn | grep rej Would remove FreeBSD/sys/dev/mlx5/mlx5_en/en_hw_tls.h.rej On Fri, Feb 11, 2022 at 9:58 AM Renato Botelho wrote: > On 11/02/22 11:38, Drew Gallatin wrote: > > > > > > 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$ > > < > 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 reject= ed > > 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 restor= e > > or git reset) to create a pristine working directory to test a clea= n > > 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 pattern= s > > can be listed in > > > > |=E2=80=A2 Patterns read from $GIT_DIR/info/exclude. =E2=80=A2 Patt= erns 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 ma= tching > > 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 > > performance reasons, so any patterns on contained files have no > > effect, no matter 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 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. > > What about -e parameter? Something like: > > git clean -x -e '*.obj' > > -- > Renato Botelho > --00000000000048f23105d7bf5a33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think that has the same problem.=C2=A0 Either that,= or I'm doing the escaping wrong.=C2=A0 Using tcsh:

<10:01am>beast/gallatin:w= ork1>git clean -ne '\!\*.orig'
Would remove ktrace.out
<= ;10:01am>beast/gallatin:work1>git clean -xn | grep rej
Would remov= e FreeBSD/sys/dev/mlx5/mlx5_en/en_hw_tls.h.rej


On Fri, Feb = 11, 2022 at 9:58 AM Renato Botelho <garga@freebsd.org> wrote:
On 11/02/22 11:38, Drew Gallatin wrote:
>
>
> On Fri, Feb 11, 2022 at 4:38 AM Kristof Provost <kp@freebsd.org
> <mailto:kp@free= bsd.org>> wrote:
>
>=C2=A0 =C2=A0 =C2=A0__
>
>=C2=A0 =C2=A0 =C2=A0On 11 Feb 2022, at 2:25, Andrew Gallatin wrote:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0On 1/17/22 04:35, Alexander V. Cherni= kov wrote:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The branch main has bee= n updated by melifaro:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0URL:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0https://u= rldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=3Db1f7154cb12517= 162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_aNhwm1heXl1CyQy= b0N5f_fiBJEkTQGhLzE7KlqqP9C7A$
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<https= ://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=3Db1f7154cb1= 2517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_aNhwm1heXl1= CyQyb0N5f_fiBJEkTQGhLzE7KlqqP9C7A$>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0commit b1f7154cb1251716= 2a51d19ae19ec3f2dee88e11
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Author: Alexander V. Ch= ernikov <melifaro@FreeBSD.org>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AuthorDate: 2022-01-08 = 16:14:47 +0000
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Commit: Alexander V. Ch= ernikov <melifaro@FreeBSD.org>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CommitDate: 2022-01-17 = 09:35:15 +0000
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0gitignore: ignore vim s= wap files & .rej/.orig
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by: cem, avg >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MFC after: 2 weeks
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Hi,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I was wondering if you might consider= reverting this change?
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Alternatively, can you teach me how t= o override this file
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0locally without carrying a diff?
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I'm asking because this makes lif= e painful for my workflow.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Having git clean be able to handle .o= rig and .rej is incredibly
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0handy when applying large patch sets.= It makes finding a rejected
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0patch as simple as 'git clean -n = | grep rej'.
>
>
>=C2=A0 =C2=A0 =C2=A0Would =E2=80=98git clean -n -x=E2=80=99 work for yo= u?
>
>=C2=A0 =C2=A0 =C2=A0|-x Don=E2=80=99t use the standard ignore rules (se= e gitignore(5)), but
>=C2=A0 =C2=A0 =C2=A0still use the ignore rules given with -e options fr= om the command
>=C2=A0 =C2=A0 =C2=A0line. This allows removing all untracked files, inc= luding build
>=C2=A0 =C2=A0 =C2=A0products. This can be used (possibly in conjunction= with git restore
>=C2=A0 =C2=A0 =C2=A0or git reset) to create a pristine working director= y to test a clean
>=C2=A0 =C2=A0 =C2=A0build. |
>
>
> Yes, except it would delete our .obj directories, which I don't wa= nt.=C2=A0
> The -x is how I figured out the .gitignore had been changed.
>
>=C2=A0 =C2=A0 =C2=A0Alternatively, the gitignore(5) man page also menti= ons that patterns
>=C2=A0 =C2=A0 =C2=A0can be listed in
>
>=C2=A0 =C2=A0 =C2=A0|=E2=80=A2 Patterns read from $GIT_DIR/info/exclude= . =E2=80=A2 Patterns read from
>=C2=A0 =C2=A0 =C2=A0the file specified by the configuration variable co= re.excludesFile. |
>
>=C2=A0 =C2=A0 =C2=A0So I=E2=80=99d think you can overrule things you do= n=E2=80=99t like from the repo
>=C2=A0 =C2=A0 =C2=A0gitignore file in $GIT_DIR/info/exclude or in your = global git
>=C2=A0 =C2=A0 =C2=A0configuration, especially combined with this:
>
>=C2=A0 =C2=A0 =C2=A0|=E2=80=A2 An optional prefix "!" which n= egates the pattern; any matching
>=C2=A0 =C2=A0 =C2=A0file excluded by a previous pattern will become inc= luded again. It
>=C2=A0 =C2=A0 =C2=A0is not possible to re-include a file if a parent di= rectory of that
>=C2=A0 =C2=A0 =C2=A0file is excluded. Git doesn=E2=80=99t list excluded= directories for
>=C2=A0 =C2=A0 =C2=A0performance reasons, so any patterns on contained f= iles have no
>=C2=A0 =C2=A0 =C2=A0effect, no matter where they are defined. Put a bac= kslash ("\") in
>=C2=A0 =C2=A0 =C2=A0front of the first "!" for patterns that = begin with a literal "!",
>=C2=A0 =C2=A0 =C2=A0for example, "\!important!.txt". |
>
>=C2=A0 =C2=A0 =C2=A0Kristof
>
>
> 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.=C2=A0 Eg:
>
> <9:32am>beast/gallatin:work1>kdump | grep NAMI | egrep
> exclude\|gitignore | head
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/home/galla= tin/.gitignore"
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/home/galla= tin/.gitignore"
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/data/ocafi= rmware/.git/info/exclude"
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"/data/ocafi= rmware/.git/info/exclude"
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0".gitignore&= quot;
>=C2=A0 =C2=A042947 git =C2=A0 =C2=A0 =C2=A0NAMI =C2=A0"FreeBSD/.gi= tignore"
>
> 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 .re= j
> files can add them to *their* local .gitignore, and we should back the= m
> out of the .gitignore for the project.

What about -e parameter?=C2=A0 Something like:

git clean -x -e '*.obj'

--
Renato Botelho
--00000000000048f23105d7bf5a33--