git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Troxel <gdt@ir.bbn.com>
To: git@vger.kernel.org
Cc: Greg Troxel <gdt@ir.bbn.com>
Subject: [PATCH] Documentation/git-update-index: caution about tree objects
Date: Thu, 20 Dec 2012 20:35:38 -0500	[thread overview]
Message-ID: <1356053738-14926-1-git-send-email-gdt@ir.bbn.com> (raw)

While one can add tree objects to the index, this is not currently
useful.  Therefore, use "git ls-tree -r" as the example to be fed to
--index-info.  Add a section explaining about expected index contents.
(Thanks to Junio for explaining this to me in August of 2011.)

Signed-off-by: Greg Troxel <gdt@ir.bbn.com>
---
 Documentation/git-update-index.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 9d0b151..6ce65fa 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -29,6 +29,11 @@ Modifies the index or directory cache. Each file mentioned is updated
 into the index and any 'unmerged' or 'needs updating' state is
 cleared.
 
+Note that update-index does not check that the modifications preserve
+the expected invariants.  In particular, an index normally holds
+regular blobs, executable blobs, symlink blobs, and gitlinks.
+Therefore, adding a tree object is not likely useful.
+
 See also linkgit:git-add[1] for a more user-friendly way to do some of
 the most common operations on the index.
 
@@ -210,7 +215,7 @@ back on 3-way merge.
 
     . mode SP type SP sha1          TAB path
 +
-The second format is to stuff 'git ls-tree' output
+The second format is to stuff 'git ls-tree -r' output
 into the index file.
 
     . mode         SP sha1 SP stage TAB path
-- 
1.8.0.1

             reply	other threads:[~2012-12-21  1:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  1:35 Greg Troxel [this message]
2012-12-21  2:56 ` [PATCH] Documentation/git-update-index: caution about tree objects Junio C Hamano

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=1356053738-14926-1-git-send-email-gdt@ir.bbn.com \
    --to=gdt@ir.bbn.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).