git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Han Young <hanyang.tony@bytedance.com>
To: boris@codesynthesis.com
Cc: git@vger.kernel.org, karen@codesynthesis.com
Subject: Re: [External] Document ability to disable template directory in git-init
Date: Fri, 4 Jul 2025 10:49:08 +0800	[thread overview]
Message-ID: <CAG1j3zEiD341X-_ZdR2puaEmZZ0ZBWSmyboyyGZaDXcDTcmAeA@mail.gmail.com> (raw)
In-Reply-To: <boris.20250703161436@codesynthesis.com>

On Thu, Jul 3, 2025 at 10:51 PM Boris Kolpackov <boris@codesynthesis.com> wrote:
> Looking at the code, this undocumented (AFAICS) behavior appears to
> be there at least from git 2.1:

Digging through the changelog, I think the feature is added in v1.5.6.4:

 "git init --template=" with blank "template" parameter linked files
 under root directories to .git, which was a total nonsense.  Instead, it
 means "I do not want to use anything from the template directory".

> I would like to suggest that we document this behavior so that it can
> be relied upon. The motivation for omitting the default template are
> repositories created by tools, such as package managers, for the sole
> purpose of fetching some information from remotes. In this case all
> the stuff copied from the template (such as hooks) is an unnecessary
> waste of time and space.
I've seen some package managers pass "--template=" to git-clone, I'd
say this is a widely used undocumented feature :P
Document the behavior would help people understand the existing
usages of --template=

Thanks.

  reply	other threads:[~2025-07-04  2:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 14:40 Document ability to disable template directory in git-init Boris Kolpackov
2025-07-04  2:49 ` Han Young [this message]
2025-07-04 10:33   ` [External] " Boris Kolpackov
2025-07-04 13:53     ` Todd Zullinger
2025-07-06  3:30       ` Jeff King
2025-07-04 14:57 ` Kristoffer Haugsbakk
2025-07-04 15:17   ` Kristoffer Haugsbakk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG1j3zEiD341X-_ZdR2puaEmZZ0ZBWSmyboyyGZaDXcDTcmAeA@mail.gmail.com \
    --to=hanyang.tony@bytedance.com \
    --cc=boris@codesynthesis.com \
    --cc=git@vger.kernel.org \
    --cc=karen@codesynthesis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).