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

Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files

From
Greg Brockman <gdb@mit.edu>
Date
Aug 12, 2010, 02:11 UTC
Message-ID
<AANLkTimg8_YAVR0ncz71Mr1+b8Q9kL9oxjjYEOpqFMoK@mail.gmail.com>
In-Reply-To
<4C630D23.5090001@web.de>
Show 21 quoted lines
> Are we talking about two different issues here?
>
> Am 11.08.2010 14:24, schrieb Ævar Arnfjörð Bjarmason:
>> On Wed, Aug 11, 2010 at 07:03, Greg Brockman <gdb@mit.edu> wrote:
>>> Currently, 'git add' will complain about excluded files, even if they
>>> are already tracked:
>
> I'm all for not complaining when adding an ignored file that is
> already tracked, as the user already told us he wants to track
> this file despite .gitignore.
>
>>> ... so it feels natural to me not
>>> to require extra user confirmation when an explicit path has been provided.
>>
>> I like it. I keep a /etc in git with .gitignore "*". This would help a
>> lot for use cases like that. Explicitly specifying a full path should
>> override gitignore IMO.
>
> I'm not so sure if we should silently add ignored files just because
> they appear on the command line. For me having to force the first time
> I do a "git add" for an otherwise ignored file looks like a feature.

Correct me if I'm wrong, but I read Ævar's use to be exactly the one I described. In particular, he presumably has a few interesting files in /etc that he tracks but wants to ignore the rest. So as far as I can tell we are all talking about the same issue.

To be clear, I certainly agree that having to force the first time you run 'git add' is a feature, and my patch explicitly does not change this functionality.

Anyway, modulo further discussion, I will add some tests and send the revised version to the list. Thanks all for looking this over.

Previous: Jens LehmannNext: Junio C Hamano
Message 4 of 28 in “git-add: Don't exclude explicitly-specified tracked files”
  1. git-add: Don't exclude explicitly-specified tracked filesGreg Brockman, Aug 11, 2010
  2. Ævar Arnfjörð BjarmasonAug 11, 2010
  3. Jens LehmannAug 11, 2010
  4. Greg BrockmanAug 12, 2010
  5. Junio C HamanoAug 11, 2010
  6. Greg BrockmanAug 11, 2010
  7. Junio C HamanoAug 12, 2010
  8. Greg BrockmanAug 12, 2010
  9. Matthieu MoyAug 12, 2010
  10. Greg BrockmanAug 12, 2010
  11. Matthieu MoyAug 12, 2010
  12. Junio C HamanoAug 12, 2010
  13. Greg BrockmanAug 12, 2010
  14. Jonathan NiederAug 12, 2010
  15. Ævar Arnfjörð BjarmasonAug 12, 2010
  16. Greg BrockmanAug 18, 2010
  17. Add test case for dealing with a tracked file in an ignored directoryGreg Brockman, Aug 18, 2010
  18. Greg BrockmanAug 18, 2010
  19. Matthieu MoyAug 18, 2010
  20. Greg BrockmanAug 19, 2010
  21. Matthieu MoyAug 19, 2010
  22. Ævar Arnfjörð BjarmasonAug 18, 2010
  23. Matthieu MoyAug 18, 2010
  24. Ævar Arnfjörð BjarmasonAug 18, 2010
  25. Jonathan NiederAug 19, 2010
  26. Ævar Arnfjörð BjarmasonAug 19, 2010
  27. Jonathan NiederAug 25, 2010
  28. Ævar Arnfjörð BjarmasonAug 29, 2010

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.