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

Re: Submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2007, 20:27 UTC
Message-ID
<7vlkcl3h7t.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vps1x3ihp.fsf@assigned-by-dhcp.cox.net>
Ok, this is my second try.
 - Incorporated Sven's suggestion to give an example of
   problematic situation on submodule after "git-checkout" at
   the supermodule level;
 - Describe semantic clean-up of specifying GIT_DIR that is
   not strictly needed (because it is situated at the normal
   place relative to the working tree).
---
diff --git a/Documentation/RelNotes-1.5.3.txt b/Documentation/RelNotes-1.5.3.txt
index 21bb1fc..bf7a341 100644
--- a/Documentation/RelNotes-1.5.3.txt
+++ b/Documentation/RelNotes-1.5.3.txt
@@ -9,6 +9,40 @@ Updates since v1.5.2
 
 * The submodule support has Porcelain layer.
 
+  Note that the current submodule support is minimal and this is
+  deliberately so.  A design decision we made is that operations
+  at the supermodule level do not recurse into submodules by
+  default.  The expectation is that later we would add a
+  mechanism to tell git which submodules the user is interested
+  in, and this information might be used to determine the
+  recursive behaviour of certain commands (e.g. "git checkout"
+  and "git diff"), but currently we haven't agreed on what that
+  mechanism should look like.  In particular, if you have any
+  submodules checked out, running a "git checkout" at the
+  supermodule level will not update these submodules.  They will
+  therefore appear to be modified (to the state prior to the
+  checkout) to any subsequent git command, until they have been
+  updated explicitly using "git submodule update".
+
+* You can have a work tree not at the parent directory of .git
+  which is the repository.  This is done with GIT_WORK_TREE
+  environment, or --work-tree option.
+
+  This support slightly changes the semantics of having GIT_DIR
+  environment variable.  The rule used to be that when it is
+  given, you are supposed to be at the top level of the working
+  tree.  However, if it names a .git directory at the top of the
+  working tree, you can be in a subdirectory of that directory
+  and git notices you are in the subdirectory.  E.g. in t/
+  subdirectory of git.git project, 
+
+	$ cd t
+	$ GIT_DIR=../.git/ git ls-files -s
+
+  will list the files in t/ (i.e. your current directory).  It
+  used not to notice that you are in a subdirectory and listed
+  the files from the top-level of the working tree.
+
 * There are a handful pack-objects changes to help you cope better
   with repositories with pathologically large blobs in them.
 
Previous: Johannes SchindelinNext: Andy Parkins
Message 15 of 19 in “Submodules”
  1. Dmitry KakurinAug 7, 2007
  2. Johannes SchindelinAug 7, 2007
  3. Dmitry KakurinAug 7, 2007
  4. Sven VerdoolaegeAug 8, 2007
  5. Johannes SchindelinAug 7, 2007
  6. Dmitry KakurinAug 7, 2007
  7. Johannes SchindelinAug 8, 2007
  8. Sven VerdoolaegeAug 8, 2007
  9. Junio C HamanoAug 8, 2007
  10. Johannes SchindelinAug 8, 2007
  11. Junio C HamanoAug 8, 2007
  12. Sven VerdoolaegeAug 8, 2007
  13. Junio C HamanoAug 8, 2007
  14. Johannes SchindelinAug 8, 2007
  15. Junio C HamanoAug 8, 2007
  16. Andy ParkinsAug 8, 2007
  17. Johannes SchindelinAug 8, 2007
  18. Sven VerdoolaegeAug 9, 2007
  19. Sven VerdoolaegeAug 8, 2007

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.