git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Apr 2019, #01; Thu, 4)

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 6, 2019, 20:28 UTC
Message-ID
<87d0lyanen.fsf@evledraar.gmail.com>
In-Reply-To
<xmqqmul5e9y0.fsf@gitster-ct.c.googlers.com>
On Thu, Apr 04 2019, Junio C Hamano wrote:
Show 22 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> On Thu, Apr 4, 2019 at 5:29 PM Junio C Hamano <gitster@pobox.com> wrote:
>>> * nd/precious (2019-04-01) 1 commit
>>>  - Introduce "precious" file concept
>>>
>>>  "git clean" learned to pay attention to the 'precious' attributes
>>>  and keep untracked paths with the attribute instead of removing.
>>>
>>>  Will merge to 'next'.
>>
>> There was no conclusion from the last thread if I remember correctly
>> and I kind of gave up on it. If you want to include anyway, should we
>> go for a more specific attribute (e.g. "clean") and leave "precious"
>> for later whenever it's better defined?
>
> I'd rather pick between (1) using the final name for the concept we
> want to eventually achieve, i.e. "precious", and starting small,
> i.e. "initially, only git-clean knows about it", or (2) doing
> nothing.  Per-command 'precious-this', 'precious-that' that would be
> left as interface wart for years is not a pretty sight I want to
> see.

I think we shouldn't squat "precious" in general without seeing where we want to go with it, which I tried to sum up in https://public-inbox.org/git/87ftsi68ke.fsf@evledraar.gmail.com/

But aside from that larger discussion, I see no problem with having some "+clean" or "-clean" attribute with basically Duy's current patch in nd/precious with the equivalent of "s/precious/clean/". Duy suggested this in https://public-inbox.org/git/CACsJy8C377NmLv9edNYjinKAQf-P1y5+Nwhdj3vRkz_E__x43Q@mail.gmail.com/

I see the desire to keep some untracked stuff you know about as different from what amounts to a workaround for merge/checkout inadvertently stomping on your checkout and shredding your data, without (as noted in my upthread summary) us having the full picture of whether that's even needed as a permanent configurable workaround, or we could "just" fix that "bug".

But on the subject on the implementation of nd/precious (assuming s/precious/clean/) I'm concerned that this "I want to keep *.o on 'git-clean'" use-case leaves us with no way to do what you can now do with:

    git clean -dxff
Now the git-clean documentation promises:
    "Cleans [...] files that are not under version control"
And, for -x:
    "Don’t use the [repository's] ignore rules[...]This allows removing
    all untracked files, including build products"

Except now we have a feature that's ostensibly exactly for this "build products" use-case, but doesn't yield to the -x option, which we've documented as being the escape hatch for exactly that sort of thing.

In my mind "clean" has two fundamentally different use-cases. a) I made this repo and trust its .gitignore file b) I didn't make it/don't trust it and/or I just want to be guaranteed to get the exact same checkout a "git clone" would give me.

Now you can do "git clean -dxff" (and if submodules init && ...) for "b", but the "precious" patch in the current form completely breaks "b" to satisfy a use-case of "a".

I think we should at the very least have a "-xx" like "-ff" now as an escape hatch, but more conservatively shouldn't be breaking the reasonable assumption a user of "-x" could make so far, which is "ignore repo config, just wipe it all".

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 19 in “What's cooking in git.git (Apr 2019, #01; Thu, 4)”
  1. Junio C HamanoApr 4, 2019
  2. Duy NguyenApr 4, 2019
  3. Junio C HamanoApr 4, 2019
  4. Ævar Arnfjörð BjarmasonApr 6, 2019
  5. Junio C HamanoApr 8, 2019
  6. Introduce "precious" file conceptNguyễn Thái Ngọc Duy, Apr 9, 2019
  7. Junio C HamanoApr 9, 2019
  8. Duy NguyenApr 10, 2019
  9. Junio C HamanoApr 12, 2019
  10. Eric SunshineApr 9, 2019
  11. Ævar Arnfjörð BjarmasonApr 12, 2019
  12. Duy NguyenApr 13, 2019
  13. Todd ZullingerApr 5, 2019
  14. Junio C HamanoApr 5, 2019
  15. Ævar Arnfjörð BjarmasonApr 6, 2019
  16. Junio C HamanoApr 8, 2019
  17. Ævar Arnfjörð BjarmasonApr 6, 2019
  18. Junio C HamanoApr 8, 2019
  19. Josh SteadmonApr 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.