# There should be a `.gitbless; file, protecting files from git clean

8 messages from 2019-01-28 to 2019-01-29. Participants: Sebastian Gniazdowski, Duy Nguyen, Junio C Hamano.
Thread: https://gitlist.dev/t/50339

## Sebastian Gniazdowski, 2019-01-28 02:41

Subject: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <etPan.5c4e6be4.2ca84d68.4d5@zdharma.org>
URL: https://gitlist.dev/e/etPan.5c4e6be4.2ca84d68.4d5%40zdharma.org

```
Hello,
Keepiing repo clean with `git clean -dxf' is a very pleasant experience. However, ability to use it ends when one gets untracked but *wanted* files in the repo, like an untracked TODO.

Could a .gitbless file be a solution? I would list in it, e.g.:

TODO

and this way be able to use `git -dxf' again. What do you think?

-- 
Sebastian Gniazdowski 
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org


```

## Duy Nguyen, 2019-01-28 05:05

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <CACsJy8BMc9k3Q=P=2CaJ9yyXhc4C_BgGVO=S_J0_R8zDweahLQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8BMc9k3Q%3DP%3D2CaJ9yyXhc4C_BgGVO%3DS_J0_R8zDweahLQ%40mail.gmail.com
In-Reply-To: <etPan.5c4e6be4.2ca84d68.4d5@zdharma.org>

```
On Mon, Jan 28, 2019 at 9:54 AM Sebastian Gniazdowski
<psprint@zdharma.org> wrote:
>
> Hello,
> Keepiing repo clean with `git clean -dxf' is a very pleasant experience. However, ability to use it ends when one gets untracked but *wanted* files in the repo, like an untracked TODO.
>
> Could a .gitbless file be a solution? I would list in it, e.g.:
>
> TODO
>
> and this way be able to use `git -dxf' again. What do you think?

There's a patch that adds "precious" git attribute [1]. I was going to
resend once the backup-log [2] got reviewed but I might just send it
separately to handle the "git clean" case alone.

[1] https://public-inbox.org/git/20181111095254.30473-1-pclouds@gmail.com/
[2] https://public-inbox.org/git/20181209104419.12639-1-pclouds@gmail.com/

>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
>


-- 
Duy

```

## Sebastian Gniazdowski, 2019-01-28 05:24

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <etPan.5c4e9217.46ea0041.4d5@zdharma.org>
URL: https://gitlist.dev/e/etPan.5c4e9217.46ea0041.4d5%40zdharma.org
In-Reply-To: <CACsJy8BMc9k3Q=P=2CaJ9yyXhc4C_BgGVO=S_J0_R8zDweahLQ@mail.gmail.com>

```
On 28 stycznia 2019 at 06:05:31, Duy Nguyen (pclouds@gmail.com) wrote:
> On Mon, Jan 28, 2019 at 9:54 AM Sebastian Gniazdowski
> wrote:
> >
> > Hello,
> > Could a .gitbless file be a solution? I would list in it, e.g.:
> >
> > TODO
> >
> > and this way be able to use `git -dxf' again. What do you think?
> 
> There's a patch that adds "precious" git attribute [1]. I was going to
> resend once the backup-log [2] got reviewed but I might just send it
> separately to handle the "git clean" case alone.

That would be nice solution. In the email, you ask for a name other than "precious". So maybe "blessed"?

-- 
Sebastian Gniazdowski 
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org


```

## Sebastian Gniazdowski, 2019-01-28 06:23

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <etPan.5c4e9fd0.4526aacd.4d5@zdharma.org>
URL: https://gitlist.dev/e/etPan.5c4e9fd0.4526aacd.4d5%40zdharma.org
In-Reply-To: <CACsJy8BMc9k3Q=P=2CaJ9yyXhc4C_BgGVO=S_J0_R8zDweahLQ@mail.gmail.com>

```
I like the idea of the backup-log, I hope it gets commited!

On 28 stycznia 2019 at 06:05:31, Duy Nguyen (pclouds@gmail.com) wrote:
> 
> There's a patch that adds "precious" git attribute [1]. I was going to
> resend once the backup-log [2] got reviewed but I might just send it
> separately to handle the "git clean" case alone.
> 
> [1] https://public-inbox.org/git/20181111095254.30473-1-pclouds@gmail.com/ 
> [2] https://public-inbox.org/git/20181209104419.12639-1-pclouds@gmail.com/ 
> 
> >
> > --
> > Sebastian Gniazdowski
> > News: https://twitter.com/ZdharmaI
> > IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> > Blog: http://zdharma.org
> >
> 
> 
> --
> Duy
> 

-- 
Sebastian Gniazdowski 
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org


```

## Sebastian Gniazdowski, 2019-01-28 15:30

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <etPan.5c4f2017.992f4fd.4d5@zdharma.org>
URL: https://gitlist.dev/e/etPan.5c4f2017.992f4fd.4d5%40zdharma.org
In-Reply-To: <CACsJy8BMc9k3Q=P=2CaJ9yyXhc4C_BgGVO=S_J0_R8zDweahLQ@mail.gmail.com>

```


On 28 stycznia 2019 at 06:05:31, Duy Nguyen (pclouds@gmail.com) wrote:
> There's a patch that adds "precious" git attribute [1]. I was going to
> resend once the backup-log [2] got reviewed but I might just send it
> separately to handle the "git clean" case alone.
> 
> [1] https://public-inbox.org/git/20181111095254.30473-1-pclouds@gmail.com/ 
> [2] https://public-inbox.org/git/20181209104419.12639-1-pclouds@gmail.com/ 


The backup log, if done properly, could allow to use git more freely, without nerves that something will beak. I wonder if it could restore also the state before an improper `git clea -dxf' call? I think the chances are low, because this would requrire to save untracked files, but it's worth asking?

-- 
Sebastian Gniazdowski 
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org


```

## Junio C Hamano, 2019-01-28 18:08

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <xmqqlg34bqpq.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqlg34bqpq.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <CACsJy8BMc9k3Q=P=2CaJ9yyXhc4C_BgGVO=S_J0_R8zDweahLQ@mail.gmail.com>

```
Duy Nguyen <pclouds@gmail.com> writes:

> There's a patch that adds "precious" git attribute [1]. I was going to
> resend once the backup-log [2] got reviewed but I might just send it
> separately to handle the "git clean" case alone.

Thanks.

```

## Duy Nguyen, 2019-01-29 00:48

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <CACsJy8Br9+m0pcErXDSsAMhhFd1xd8X0LfvLJvy63P45TX-zGQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Br9%2Bm0pcErXDSsAMhhFd1xd8X0LfvLJvy63P45TX-zGQ%40mail.gmail.com
In-Reply-To: <etPan.5c4e9217.46ea0041.4d5@zdharma.org>

```
On Mon, Jan 28, 2019 at 12:24 PM Sebastian Gniazdowski
<psprint@zdharma.org> wrote:
>
> On 28 stycznia 2019 at 06:05:31, Duy Nguyen (pclouds@gmail.com) wrote:
> > On Mon, Jan 28, 2019 at 9:54 AM Sebastian Gniazdowski
> > wrote:
> > >
> > > Hello,
> > > Could a .gitbless file be a solution? I would list in it, e.g.:
> > >
> > > TODO
> > >
> > > and this way be able to use `git -dxf' again. What do you think?
> >
> > There's a patch that adds "precious" git attribute [1]. I was going to
> > resend once the backup-log [2] got reviewed but I might just send it
> > separately to handle the "git clean" case alone.
>
> That would be nice solution. In the email, you ask for a name other than "precious". So maybe "blessed"?

There's a couple mail replies in that thread that pointed out
"precious" has been used elsewhere (I think Makefile is one) so I
think I'm going to stick with "precious". Besides it sounds "precious"
:D
-- 
Duy

```

## Duy Nguyen, 2019-01-29 01:00

Subject: Re: There should be a `.gitbless; file, protecting files from git clean
Message-ID: <CACsJy8AjMamr3kNf67SkYxKrDPHWcf=W2eArMRMnX3H6hXWe7A@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8AjMamr3kNf67SkYxKrDPHWcf%3DW2eArMRMnX3H6hXWe7A%40mail.gmail.com
In-Reply-To: <etPan.5c4f2017.992f4fd.4d5@zdharma.org>

```
On Mon, Jan 28, 2019 at 10:30 PM Sebastian Gniazdowski
<psprint@zdharma.org> wrote:
>
>
>
> On 28 stycznia 2019 at 06:05:31, Duy Nguyen (pclouds@gmail.com) wrote:
> > There's a patch that adds "precious" git attribute [1]. I was going to
> > resend once the backup-log [2] got reviewed but I might just send it
> > separately to handle the "git clean" case alone.
> >
> > [1] https://public-inbox.org/git/20181111095254.30473-1-pclouds@gmail.com/
> > [2] https://public-inbox.org/git/20181209104419.12639-1-pclouds@gmail.com/
>
>
> The backup log, if done properly, could allow to use git more freely, without nerves that something will beak. I wonder if it could restore also the state before an improper `git clea -dxf' call? I think the chances are low, because this would requrire to save untracked files, but it's worth asking?

backup-log already saves untracked files for "git reset --hard"
support if I remember correctly. Adding support for "git clean" is not
that big a deal. It's just the matter whether to turn it on by default
(because there will be a lot of files being backed up). But now that I
think about it, if backup log is enabled, perhaps we allow "git clean
-dx" (without -f or -i) which will back up all deleted files, while
-fdx will not. Hmm...
-- 
Duy

```
