git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question - .git subdirectories
@ 2019-10-29 12:26 Arkadij Chistyj
  2019-10-31 20:20 ` brian m. carlson
  2019-10-31 23:01 ` Jonathan Nieder
  0 siblings, 2 replies; 4+ messages in thread
From: Arkadij Chistyj @ 2019-10-29 12:26 UTC (permalink / raw)
  To: git

Hello. I'm not sure it's correctly to write to this email address.
Sorry if it doesn't.
Copy of my home directory stores on external disk under git control. I
have devel/ directory that contains some of my old projects with git
repositories. But main git repository in root of disk is not tracking
and storing their contents. I don't want to use submodules or crutches
such as renaming all .git/ in subdirectories. I just want that git
treats my .git/ subdirs as plain dirs with any other names.
It was already described here:
https://stackoverflow.com/questions/2317652/nested-git-repositories-without-submodules.
It's very simple functionality but I can't find any simple and right solution.
I just want to know is this possible or not? If not possible, then why?
Thank you in advance.

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

* Re: Question - .git subdirectories
  2019-10-29 12:26 Question - .git subdirectories Arkadij Chistyj
@ 2019-10-31 20:20 ` brian m. carlson
  2019-10-31 23:01 ` Jonathan Nieder
  1 sibling, 0 replies; 4+ messages in thread
From: brian m. carlson @ 2019-10-31 20:20 UTC (permalink / raw)
  To: Arkadij Chistyj; +Cc: git

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

On 2019-10-29 at 12:26:23, Arkadij Chistyj wrote:
> Hello. I'm not sure it's correctly to write to this email address.
> Sorry if it doesn't.
> Copy of my home directory stores on external disk under git control. I
> have devel/ directory that contains some of my old projects with git
> repositories. But main git repository in root of disk is not tracking
> and storing their contents. I don't want to use submodules or crutches
> such as renaming all .git/ in subdirectories. I just want that git
> treats my .git/ subdirs as plain dirs with any other names.
> It was already described here:
> https://stackoverflow.com/questions/2317652/nested-git-repositories-without-submodules.
> It's very simple functionality but I can't find any simple and right solution.
> I just want to know is this possible or not? If not possible, then why?

This is not possible.  You can't add a non-bare repository as a part of
a parent repository without using submodules.  Git uses the .git
directory to find the working tree and for safety reasons doesn't allow
files or directories named that to be checked in.  Allowing users to
check in .git directories would allow configuration and hooks to be
stored as part of the repository, which would allow the execution of
arbitrary code if someone cloned it and then changed into the
subrepository.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

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

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

* Re: Question - .git subdirectories
  2019-10-29 12:26 Question - .git subdirectories Arkadij Chistyj
  2019-10-31 20:20 ` brian m. carlson
@ 2019-10-31 23:01 ` Jonathan Nieder
  2019-11-02 19:14   ` Arkadij Chistyj
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2019-10-31 23:01 UTC (permalink / raw)
  To: Arkadij Chistyj; +Cc: git, brian m. carlson

Hi Arkadij,

Arkadij Chistyj wrote:
>                                               I just want that git
> treats my .git/ subdirs as plain dirs with any other names.
[...]
> It's very simple functionality but I can't find any simple and right solution.
> I just want to know is this possible or not? If not possible, then why?

To add to what brian wrote:

This is one of many things that Git doesn't track:

- empty directories
- full permissions for files it's tracking
- owner, group, other attributes
- resource fork on filesystems that support multiple forks

Git was initially designed to handle source code.  Later, people have
started to use it for tracking other kinds of documents, which has been
nice.  In general, when push comes to shove, the project has prioritized
making it work well for tracking source code and other documents.

Sometimes people find other uses for Git (deployment tool! home
directory tracker! configuration management system!).  It can be
fun[1]. :)  Ultimately, though, it's useful to keep the main goals of
Git in mind.

Sometimes people want to track a Git repository in another repository
as a source of test data for tests they include with their code.  For
this use, using a "git fast-export" stream or other method for
generating a repository at test time can work better, or, if one
really must use a repo-in-repo, using a bare repository.  Brian did a
good job of describing why.

Thanks and hope that helps,
Jonathan

[1] https://public-inbox.org/git/?q=ugfwiini

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

* Re: Question - .git subdirectories
  2019-10-31 23:01 ` Jonathan Nieder
@ 2019-11-02 19:14   ` Arkadij Chistyj
  0 siblings, 0 replies; 4+ messages in thread
From: Arkadij Chistyj @ 2019-11-02 19:14 UTC (permalink / raw)
  To: jrnieder, sandals; +Cc: git

Thanks you very much for the answer! It was very interesting for me
and now I can understand why this doesn't work.
Have a nice weekend.

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

end of thread, other threads:[~2019-11-02 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 12:26 Question - .git subdirectories Arkadij Chistyj
2019-10-31 20:20 ` brian m. carlson
2019-10-31 23:01 ` Jonathan Nieder
2019-11-02 19:14   ` Arkadij Chistyj

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