Re: Suggestion: Enhance git init with Language-Specific Templates
- From
Oleg Taranenko <olegtaranenko@gmail.com>
- Date
- Mar 5, 2025, 23:53 UTC
- Message-ID
- <CABEd3j-36C_LUOetg0qLofrby9M1Hixkh4o7sQkkyyWuTqHQvQ@mail.gmail.com>
- In-Reply-To
- <xmqq1pvbks3i.fsf@gitster.g>
On Wed, 5 Mar 2025 at 23:53, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> I wouldn't have thrown objects in the --template directory, and I > wouldn't count on things outside what the mechanism was invented for > (namely, .git/hooks and possibly .git/info/ files) would forever be > copied in newer versions of Git, but certainly "git init --template" > mechanism sounds like a good escape hatch than mucking with Git code > base to teach it myriad of languages and their dialects.
It sounds like creating a copy of the .gitignore structure requires the user to learn bash script syntax. :-D I'd like to suggest adding one more option to the init --template <template/dir> --only-gitignores. It will not deal with all the complicated mechanics behind hooks/etc, and will only look at the template folder structure and copy **/.gitignore into the newly created worktree. In case of existing .gitignore files, just put warnings and do not override those.
--Oleg