# Feature Request

2 messages from 2024-06-20 to 2024-06-20. Participants: Clement Sello Tsetsa, rsbecker@nexbridge.com.
Thread: https://gitlist.dev/t/61655

## Clement Sello Tsetsa, 2024-06-20 12:58

Subject: Feature Request
Message-ID: <CAOqo0cWd5BK5zAgMmsWPYFuWscLvuOq0Gq_a5PH-oXJoGrPb_w@mail.gmail.com>
URL: https://gitlist.dev/e/CAOqo0cWd5BK5zAgMmsWPYFuWscLvuOq0Gq_a5PH-oXJoGrPb_w%40mail.gmail.com

```
Greetings;

My name is Clement and I am a second year student at NWU university in
South Africa studying towards a bachelor's degree in information
technology, i just recently learned about Git and it is a fascinating
piece of technology. This is my first time making a feature request
for anything and please excuse me if it is not up to your standards in
any way. Please read the below text as it is the feature request:

When initializing a Git repository, allow specifying file types to
track using the command git init <file>. If no file type is specified,
Git should track all file types by default. Additionally,
automatically create the .gitignore file during initialization, and as
new file types are created, add them to the ignore list. Later, when
adding files to the staging environment, Git will already know which
types to include or ignore using the git add <file> command.

I think the user should not have to create the .gitignore file in the
future if this is implementable.

Kind regards
CS Tsetsa

```

## rsbecker@nexbridge.com, 2024-06-20 13:29

Subject: RE: Feature Request
Message-ID: <009e01dac315$d6399b40$82acd1c0$@nexbridge.com>
URL: https://gitlist.dev/e/009e01dac315%24d6399b40%2482acd1c0%24%40nexbridge.com
In-Reply-To: <CAOqo0cWd5BK5zAgMmsWPYFuWscLvuOq0Gq_a5PH-oXJoGrPb_w@mail.gmail.com>

```
On Thursday, June 20, 2024 8:58 AM. Clement Sello Tsetsa wrote:
>My name is Clement and I am a second year student at NWU university in South
>Africa studying towards a bachelor's degree in information technology, i just
>recently learned about Git and it is a fascinating piece of technology. This is my first
>time making a feature request for anything and please excuse me if it is not up to
>your standards in any way. Please read the below text as it is the feature request:
>
>When initializing a Git repository, allow specifying file types to track using the
>command git init <file>. If no file type is specified, Git should track all file types by
>default. Additionally, automatically create the .gitignore file during initialization, and
>as new file types are created, add them to the ignore list. Later, when adding files to
>the staging environment, Git will already know which types to include or ignore
>using the git add <file> command.
>
>I think the user should not have to create the .gitignore file in the future if this is
>implementable.

Can you clarify what you mean by "file types"? In a cross-platform distributed situation, file types can be interpreted as a combination of file extensions, file encodings, and internal contents. .gitignore only deals with name matching patterns, so cannot reflect inclusion of exclusion of internal content types (for example *.doc with UTF-8 vs. US-ASCII content).

This is an interesting idea but seems to require that git build a generic mechanism for determining file types on all supported platforms and extending .gitignore to represent internal types . This is definitely non-trivial. In Linux, for example, the 'file' command can determine the internal guts of some files, as in:

$ file myfile
myfile:    TNS/X PIC object format,64-bit data model,executable,NonStop OSS target

Note that there is no file extension above.

Can you please clarify what you are looking for in this area?

I would also suggest that you look into both git templates and git hooks. The combination might help cover at least part of this. Specifically, the pre-commit hook might help with management of the .gitignore file.

Regards,
Randall


```
