git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Greg Troxel <gdt@ir.bbn.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Documentation/git-update-index: caution about tree objects
Date: Thu, 20 Dec 2012 18:56:58 -0800	[thread overview]
Message-ID: <7vvcbw2jut.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1356053738-14926-1-git-send-email-gdt@ir.bbn.com> (Greg Troxel's message of "Thu, 20 Dec 2012 20:35:38 -0500")

Greg Troxel <gdt@ir.bbn.com> writes:

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

I find this unnecessarily alarmist as a description meant for
general audiences.  For the normal mode of operations of the command
(e.g. "git update-index --add --remove hello.c"), whatever you mean
by "expected invariants" are fully preserved.

I think you meant this for --cacheinfo and --index-info options,
which are primarily meant for people who know what they are doing
(that includes the use of this command in scripted Porceains) or Git
developers who want to work on enhancing the index (and to them,
being able to record anything is more convenient).

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

This hunk is good.

Thanks.

      reply	other threads:[~2012-12-21  2:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  1:35 [PATCH] Documentation/git-update-index: caution about tree objects Greg Troxel
2012-12-21  2:56 ` Junio C Hamano [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=7vvcbw2jut.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=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).