From: Jonathan Nieder <jrnieder@gmail.com>
To: Antony Stubbs <antony.stubbs@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Add repos but not as normal files, not submodule
Date: Wed, 14 Apr 2010 15:13:08 -0500 [thread overview]
Message-ID: <20100414201308.GA4118@progeny.tock> (raw)
In-Reply-To: <7118B4DB-A95F-424F-87EF-035B36E578FB@gmail.com>
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@gmail.com>
---
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
prev parent reply other threads:[~2010-04-14 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-14 4:11 Add repos but not as normal files, not submodule Antony Stubbs
2010-04-14 9:36 ` Jonathan Nieder
2010-04-14 11:02 ` Antony Stubbs
2010-04-14 20:13 ` Jonathan Nieder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100414201308.GA4118@progeny.tock \
--to=jrnieder@gmail.com \
--cc=antony.stubbs@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).