Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2022 10:38:16 +0100
From:      Kristof Provost <kp@FreeBSD.org>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        "Alexander V. Chernikov" <melifaro@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, gallatin@netflix.com, Conrad Meyer <cem@freebsd.org>, Andriy Gapon <avg@FreeBSD.org>
Subject:   Re: git: b1f7154cb125 - main - gitignore: ignore vim swap files & .rej/.orig
Message-ID:  <4FC1EDC4-9F20-4271-B468-715A1727AC8A@FreeBSD.org>
In-Reply-To: <72061959-88f8-d2ee-b4e9-f09ca084411e@cs.duke.edu>
References:  <202201170935.20H9ZM3T069547@gitrepo.freebsd.org> <72061959-88f8-d2ee-b4e9-f09ca084411e@cs.duke.edu>

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

[-- Attachment #1 --]
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=b1f7154cb12517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_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 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 ‘git clean -n -x’ work for you?

        -x
            Don’t 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.

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

        •   Patterns read from $GIT_DIR/info/exclude.

        •   Patterns read from the file specified by the configuration 
variable
            core.excludesFile.

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

        •   An optional prefix "!" which negates the pattern; 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’t 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
[-- 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 2:25, Andrew 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">On 1/17/22 04:35, Alexander V. Chernikov wrote:</p>
<blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #136BCE; border-left-color: #4B89CF; color: #4B89CF;"><p dir="auto">The branch main has been updated by melifaro:</p>
<p dir="auto">URL: <a href="https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=b1f7154cb12517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_aNhwm1heXl1CyQyb0N5f_fiBJEkTQGhLzE7KlqqP9C7A$">https://urldefense.com/v3/__https://cgit.FreeBSD.org/src/commit/?id=b1f7154cb12517162a51d19ae19ec3f2dee88e11__;!!OToaGQ!4Lozvj8S2Opxre6qHuywX_aNhwm1heXl1CyQyb0N5f_fiBJEkTQGhLzE7KlqqP9C7A$</a></p>;
<p dir="auto">commit b1f7154cb12517162a51d19ae19ec3f2dee88e11
<br>
Author:     Alexander V. Chernikov &lt;melifaro@FreeBSD.org&gt;
<br>
AuthorDate: 2022-01-08 16:14:47 +0000
<br>
Commit:     Alexander V. Chernikov &lt;melifaro@FreeBSD.org&gt;
<br>
CommitDate: 2022-01-17 09:35:15 +0000</p>
<p dir="auto">     gitignore: ignore vim swap files &amp; .rej/.orig
<br>
         Reviewed by:    cem, avg
<br>
     MFC after:      2 weeks</p>
</blockquote><p dir="auto">Hi,</p>
<p dir="auto">I was wondering if you might consider reverting this change?
<br>
Alternatively, can you teach me how to override this file
<br>
locally without carrying a diff?</p>
<p dir="auto">I'm asking because this makes life painful for my workflow.</p>
<p dir="auto">Having git clean be able to handle .orig and .rej is incredibly
<br>
handy when applying large patch sets.  It makes finding a rejected
<br>
patch as simple as 'git clean -n | grep rej'.</p>
<br></blockquote></div>
<div class="markdown" style="white-space: normal;">
<p dir="auto">Would ‘git clean -n -x’ work for you?</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>   -x
       Don’t 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.
</code></pre>
<p dir="auto">Alternatively, the gitignore(5) man page also mentions that patterns can be listed in</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>   •   Patterns read from $GIT_DIR/info/exclude.

   •   Patterns read from the file specified by the configuration variable
       core.excludesFile.
</code></pre>
<p dir="auto">So I’d think you can overrule things you don’t like from the repo gitignore file in $GIT_DIR/info/exclude or in your global git configuration, especially combined with 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>   •   An optional prefix &quot;!&quot; which negates the pattern; 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’t list excluded directories for performance
       reasons, so any patterns on contained files have no effect, no matter
       where they are defined. Put a backslash (&quot;\&quot;) in front of the first
       &quot;!&quot; for patterns that begin with a literal &quot;!&quot;, for example,
       &quot;\!important!.txt&quot;.
</code></pre>
<p dir="auto">Kristof</p>

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

</html>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FC1EDC4-9F20-4271-B468-715A1727AC8A>