Re: Add repos but not as normal files, not submodule

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Antony Stubbs wrote:

>> I’d suggest
>> writing a simple script to build the test repository from scratch.
>
> Yup - will probably go down this route.

Ah, good.

>> You can also try using repositories not named .git if you are careful.
>> I don’t really encourage this.
>
> Didn't realize this was possible.

 ; git init foo
 ; git init --bare foo/bar.git
 ; cd foo
 ; git add bar.git

or

 ; git init foo
 ; git init foo/bar
 ; mv foo/bar/.git foo/bar.git
 ; git add bar bar.git
 ; cd bar
 ; GIT_DIR=$(pwd)/../bar.git git status
 ; (ln -s ../bar.git .git && git status && rm .git)

Please, don’t do this.  For all I know, some git command will end
up chdir()ing into bar.git and getting confused.

> Any pointers? Links?

I’m not aware of the relevant rules being documented anywhere.  How
much of the current behavior do we want to commit to continuing to
support?

Here’s a (very rough) start.  Thoughts?

-- 8< --
Subject: Documentation/update-index: indicate what the index can contain

Based on cache.h.

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 Documentation/git-update-index.txt |   37 ++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 68dc187..3f74938 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -29,6 +29,12 @@ Modifies the index or directory cache. Each file mentioned is updated
 into the index and any 'unmerged' or 'needs updating' state is
 cleared.
 
+Paths that do not represent directories, regular files, or symlinks
+are ignored (though other file types may be supported in future
+versions of git).  Files and directories named .git are ignored except
+for the sake of detecting subrepositories.  See the "Content model"
+section below for more about what the index can track.
+
 See also linkgit:git-add[1] for a more user-friendly way to do some of
 the most common operations on the index.
 
@@ -159,6 +165,37 @@ you will need to handle the situation manually.
 	cleaner names.
 	The same applies to directories ending '/' and paths with '//'
 
+Content model
+-------------
+Roughly speaking, the index represents the state of the working tree
+at some moment.  Each entry indicates the name of a file, its mode,
+the name of a blob or tree object representing its content (0 for a
+removed file or directory), a stage number, flags, and some lstat(2)
+information that can be used to check if the entry is up-to-date.
+
+Filenames are relative to the top level of the working tree and
+contain no empty path components or path components named ., ..,
+or .git, or symbolic link path components.
+
+Modes are based on the octal values as returned by lstat(2):
+
+. `100644` (regular file)
+. `100755` (executable)
+. `120000` (symbolic link)
+. `040000` (directory)
+. `160000` (git submodule)
+
+All other file types are either reduced to one of these five or
+ignored.
+
+See linkgit:git-read-tree(1) for a description of the stages in
+the index.  When a merge is not in progress, all entries have stage
+number 0.
+
+There are currently three boolean flags that can be set.  See
+the descriptions of the `--asumed-unchanged` and `--skip-worktree`
+options above and the `--intent-to-add` option to linkgit:git-add[1].
+
 Using --refresh
 ---------------
 '--refresh' does not calculate a new sha1 file or bring the index
-- 
1.7.1.rc1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]