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
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
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
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
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