git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* does a new repo actually *need* default template content?
@ 2018-05-28 13:00 Robert P. J. Day
  2018-05-28 17:56 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Robert P. J. Day @ 2018-05-28 13:00 UTC (permalink / raw)
  To: Git Mailing list

[-- Attachment #1: Type: text/plain, Size: 2136 bytes --]


  (apologies for more pedantic nitpickery, just little things i'm
running across in my travels. aside: i actually teach git courses, so
it's a bit embarrassing that i don't know some of this stuff. *sigh*.)

  running on fully-updated fedora 28 system:

  $ git --version
  git version 2.17.0
  $

  is there anything in /usr/share/git-core/templates/ that is actually
*essential* when initializing a new repo? this is what's in my
directory by that name:

  ├── branches
  ├── description
  ├── hooks
  │   ├── applypatch-msg.sample
  │   ├── commit-msg.sample
  │   ├── fsmonitor-watchman.sample
  │   ├── post-update.sample
  │   ├── pre-applypatch.sample
  │   ├── pre-commit.sample
  │   ├── prepare-commit-msg.sample
  │   ├── pre-push.sample
  │   ├── pre-rebase.sample
  │   ├── pre-receive.sample
  │   └── update.sample
  └── info
      └── exclude

but none of that above looks critically important.

  "man gitrepository-layout" describes the "branches" directory as
"slightly deprecated", the default description file has a generic
"Unnamed repository" message but, hey, so does the git source code
repo itself, the hooks are all "commented out", and the info/exclude
file effectively has no content, so i'm guessing that nothing there
actually needs to be used to populate a new repo via "git init",
correct?

  under the circumstances, then, should it be a viable option to
initialize a new repo while specifying you want *no* initial template
content? it appears you can do that just by specifying a bogus
template directory (or even /dev/null) with "--template=", but that
generates a "warning" -- does a selection like that even merit a
"warning" if it's clear that's what i'm trying to do?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: does a new repo actually *need* default template content?
  2018-05-28 13:00 does a new repo actually *need* default template content? Robert P. J. Day
@ 2018-05-28 17:56 ` Ævar Arnfjörð Bjarmason
  2018-06-01  7:06   ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-05-28 17:56 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Git Mailing list


On Mon, May 28 2018, Robert P. J. Day wrote:

>   (apologies for more pedantic nitpickery, just little things i'm
> running across in my travels. aside: i actually teach git courses, so
> it's a bit embarrassing that i don't know some of this stuff. *sigh*.)

Aside from maybe the empty branches/ directory (see c8a58ac5a5 ("Revert
"Don't create the $GIT_DIR/branches directory on init"", 2009-10-31)),
none of this is needed.

I wish we didn't create any of this stuff, but have never been inclined
to make that my hill to die on.

I think we're much better off just shipping e.g. a single README file in
hooks/, or just nothing at all.

We should at least do something different on "git init --bare than" a
plain "git clone". By a quick check I have 20MB worth of 4 thousand
copies of 36 unique variations .git/hooks versions in my local area
where I clone random stuff to, none of which uses any hooks.

I think we shouldn't do anything on --bare either, except maybe a small
README_GIT_REPOSITORY_FORMAT which would refer to
gitrepository-layout(5) and a system-wide template directory.

This might have been more useful back in the early days at a time where
it was common for git users to host their own repositories, but almost
nobody does that anymore, and if they do they're expert level users who
can just get these hooks with a "cp -R".



>   running on fully-updated fedora 28 system:
>
>   $ git --version
>   git version 2.17.0
>   $
>
>   is there anything in /usr/share/git-core/templates/ that is actually
> *essential* when initializing a new repo? this is what's in my
> directory by that name:
>
>   ├── branches
>   ├── description
>   ├── hooks
>   │ ├── applypatch-msg.sample
>   │ ├── commit-msg.sample
>   │ ├── fsmonitor-watchman.sample
>   │ ├── post-update.sample
>   │ ├── pre-applypatch.sample
>   │ ├── pre-commit.sample
>   │ ├── prepare-commit-msg.sample
>   │ ├── pre-push.sample
>   │ ├── pre-rebase.sample
>   │ ├── pre-receive.sample
>   │ └── update.sample
>   └── info
>       └── exclude
>
> but none of that above looks critically important.
>
>   "man gitrepository-layout" describes the "branches" directory as
> "slightly deprecated", the default description file has a generic
> "Unnamed repository" message but, hey, so does the git source code
> repo itself, the hooks are all "commented out", and the info/exclude
> file effectively has no content, so i'm guessing that nothing there
> actually needs to be used to populate a new repo via "git init",
> correct?
>
>   under the circumstances, then, should it be a viable option to
> initialize a new repo while specifying you want *no* initial template
> content? it appears you can do that just by specifying a bogus
> template directory (or even /dev/null) with "--template=", but that
> generates a "warning" -- does a selection like that even merit a
> "warning" if it's clear that's what i'm trying to do?
>
> rday

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: does a new repo actually *need* default template content?
  2018-05-28 17:56 ` Ævar Arnfjörð Bjarmason
@ 2018-06-01  7:06   ` Jeff King
  2018-06-01 14:38     ` Santiago Torres
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2018-06-01  7:06 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Robert P. J. Day, Git Mailing list

On Mon, May 28, 2018 at 07:56:12PM +0200, Ævar Arnfjörð Bjarmason wrote:

> 
> On Mon, May 28 2018, Robert P. J. Day wrote:
> 
> >   (apologies for more pedantic nitpickery, just little things i'm
> > running across in my travels. aside: i actually teach git courses, so
> > it's a bit embarrassing that i don't know some of this stuff. *sigh*.)
> 
> Aside from maybe the empty branches/ directory (see c8a58ac5a5 ("Revert
> "Don't create the $GIT_DIR/branches directory on init"", 2009-10-31)),
> none of this is needed.
> 
> I wish we didn't create any of this stuff, but have never been inclined
> to make that my hill to die on.
> 
> I think we're much better off just shipping e.g. a single README file in
> hooks/, or just nothing at all.

FWIW, that's my opinion, too (including the "hill to die on" part).

I also wish hooks were just shell snippets in the config files that
could follow the usual config-precedence rules.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: does a new repo actually *need* default template content?
  2018-06-01  7:06   ` Jeff King
@ 2018-06-01 14:38     ` Santiago Torres
  0 siblings, 0 replies; 4+ messages in thread
From: Santiago Torres @ 2018-06-01 14:38 UTC (permalink / raw)
  To: Jeff King
  Cc: Ævar Arnfjörð Bjarmason, Robert P. J. Day,
	Git Mailing list

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

On Fri, Jun 01, 2018 at 03:06:10AM -0400, Jeff King wrote:
> On Mon, May 28, 2018 at 07:56:12PM +0200, Ævar Arnfjörð Bjarmason wrote:
> 
> > 
> > On Mon, May 28 2018, Robert P. J. Day wrote:
> > 
> > >   (apologies for more pedantic nitpickery, just little things i'm
> > > running across in my travels. aside: i actually teach git courses, so
> > > it's a bit embarrassing that i don't know some of this stuff. *sigh*.)
> > 
> > Aside from maybe the empty branches/ directory (see c8a58ac5a5 ("Revert
> > "Don't create the $GIT_DIR/branches directory on init"", 2009-10-31)),
> > none of this is needed.
> > 
> > I wish we didn't create any of this stuff, but have never been inclined
> > to make that my hill to die on.
> > 
> > I think we're much better off just shipping e.g. a single README file in
> > hooks/, or just nothing at all.
> 
> FWIW, that's my opinion, too (including the "hill to die on" part).
> 

+1. It'd probably be worth having the sample hooks be part of the
installation, but not as part of every repository (e.g., hold them under
/usr/share/git/samples/hooks/ or something along those lines).

> I also wish hooks were just shell snippets in the config files that
> could follow the usual config-precedence rules.

I like this idea, but I'd probably keep the snippets in a separate file
to keep things clean.

Thanks,
-Santiago.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-01 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 13:00 does a new repo actually *need* default template content? Robert P. J. Day
2018-05-28 17:56 ` Ævar Arnfjörð Bjarmason
2018-06-01  7:06   ` Jeff King
2018-06-01 14:38     ` Santiago Torres

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).