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

Re: dotfiles in git template dir are not copied

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2017, 22:56 UTC
Message-ID
<xmqqk28opgsy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<2bae8d8a-f0bf-fa8b-8ce4-6880d3490b43@greg0ire.fr>
Grégoire PARIS <postmaster@greg0ire.fr> writes:
Show 5 quoted lines
>> You could, for example, have your template directory itself be a git 
> repository.
>
> I can and I do and indeed, that might be the reason behind this.
> I made a PR to document this : https://github.com/git/git/pull/325
Let's take a look.
Show 12 quoted lines
> From: Grégoire PARIS <postmaster@greg0ire.fr>
> Date: Fri, 17 Feb 2017 22:33:40 +0100
> Subject: [PATCH] Document dotfiles exclusion on template copy
> 
> Since there is no dotfile in the default template directory, there was
> no point in making the check for . or .. more accurate when copying. Now
> that you can customize the template directory, it would make sense, but
> it's actually a good thing to at this because you would not want to have
> your git directory copied in every git directory that is created should
> you decide to put your template directory under version control. Plus it
> might be used as a feature by people who would want to exclude some
> files.
OK.
> See https://public-inbox.org/git/20170217204411.2yixhuazgczxmmxa@sigill.intra.peff.net/T/#t
I do not think what was discussed there adds much.  Drop this line.
Instead, add your sign-off (Documentation/SubmittingPatches) here
    Signed-off-by: Grégoire PARIS <postmaster@greg0ire.fr>
Show 14 quoted lines
> ---
>  Documentation/git-init.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
> index 9d27197de8..e3b185cf86 100644
> --- a/Documentation/git-init.txt
> +++ b/Documentation/git-init.txt
> @@ -117,7 +117,7 @@ TEMPLATE DIRECTORY
>  ------------------
>  
>  The template directory contains files and directories that will be copied to
> -the `$GIT_DIR` after it is created.
> +the `$GIT_DIR` after it is created, unless their name starts with a dot.

"... that will be copied ..., unless they are dot" is not incorrect per-se, but perhaps rewriting the whole sentence, e.g. "Files and directories in the template directory whose name do not start with a dot will be copied to ...", may make it easier to read, I suspect.

Previous: Grégoire PARISNext: Grégoire PARIS
Message 10 of 12 in “dotfiles in git template dir are not copied”
  1. greg0ireFeb 17, 2017
  2. Jeff KingFeb 17, 2017
  3. Grégoire PARISFeb 17, 2017
  4. Junio C HamanoFeb 17, 2017
  5. Grégoire PARISFeb 17, 2017
  6. Junio C HamanoFeb 17, 2017
  7. Grégoire PARISFeb 17, 2017
  8. Philip OakleyFeb 17, 2017
  9. Grégoire PARISFeb 17, 2017
  10. Junio C HamanoFeb 17, 2017
  11. Grégoire PARISFeb 17, 2017
  12. Grégoire PARISFeb 17, 2017

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.