dotfiles in git template dir are not copied

5 messages, 3 authors, 2017-02-17 · open the first message on its own page

dotfiles in git template dir are not copied

From: greg0ire <hidden>
Date: 2017-02-17 13:10:59

Hi,

I noticed yesterday that dotfiles inside the directory configured in 
init.templatedir are not copied when creating a new repository.

Here is the line I think is responsible for this behavior : 
https://github.com/git/git/blob/master/builtin/init-db.c#L48

Is it a bug or a feature?

Steps to reproduce, provided you already have a template dir configured :

cd $(git config --path --get init.templatedir)
touch copied
touch .not_copied
cd /tmp
mkdir whatever
cd whatever
git init
ls -la .git

On my machine, the last command does not list .not_copied .

--
greg0ire

Re: dotfiles in git template dir are not copied

From: Jeff King <hidden>
Date: 2017-02-17 20:44:24

On Fri, Feb 17, 2017 at 10:31:37AM +0100, greg0ire wrote:
I noticed yesterday that dotfiles inside the directory configured in
init.templatedir are not copied when creating a new repository.

Here is the line I think is responsible for this behavior :
https://github.com/git/git/blob/master/builtin/init-db.c#L48

Is it a bug or a feature?
I think it's probably a feature. You could, for example, have your
template directory itself be a git repository. You would not want to
copy the ".git" directory around.

I wouldn't be surprised if the documentation could be improved, though.

-Peff

Re: Re: dotfiles in git template dir are not copied

From: Grégoire PARIS <hidden>
Date: 2017-02-17 21:51:09

 > 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

--
greg0ire

Re: Re: dotfiles in git template dir are not copied

From: Philip Oakley <hidden>
Date: 2017-02-17 22:39:09

From: "Grégoire PARIS" <redacted>
quoted
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
While the PR is a simple one line change to the documention, the patch 
should be submitted to the list.
See Documenation/SubmittingPatches

Don't forget to Sign Off your patch (see the Developer's Certificate of 
Origin section).
--
Philip 

Re: dotfiles in git template dir are not copied

From: Grégoire PARIS <hidden>
Date: 2017-02-17 22:49:21

Le 17/02/2017 à 23:39, Philip Oakley a écrit :
From: "Grégoire PARIS" <redacted>
quoted
quoted
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
While the PR is a simple one line change to the documention, the patch 
should be submitted to the list.
See Documenation/SubmittingPatches

Don't forget to Sign Off your patch (see the Developer's Certificate 
of Origin section).
-- 
Philip
Ok sorry, I'll fix this rightaway!
--
greg0ire
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help