git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Chris Torek <chris.torek@gmail.com>
To: Sean Allred <allred.sean@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Using git-update-index to add existing tree objects at other paths
Date: Tue, 4 Oct 2022 08:10:25 -0700	[thread overview]
Message-ID: <CAPx1GvfsRipG0qgDmMMoU+WCWCEyr4ayJteYWAy+EoJOoaNQXg@mail.gmail.com> (raw)
In-Reply-To: <87o7ur1wi9.fsf@gmail.com>

On Tue, Oct 4, 2022 at 7:43 AM Sean Allred <allred.sean@gmail.com> wrote:
> ... but the following does not work:
>
>     $ cat | git update-index --index-info
>     040000 tree TREEID1 PATH1

The index is not designed to hold tree objects (at least not at this level),
and update-index should be fed only the full path names of files, symbolic
links (mode 120000), or gitlinks (mode 160000).

Whether it's reasonable to ask for the update-index command to
understand that `040000 tree <treeid> <path>` means to insert all
the files *within* the given (existing) tree object, at the implied
constructed paths, I'll leave as an open topic here. :-) But if you
were to do this manually yourself, it should work.

Chris

  reply	other threads:[~2022-10-04 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 13:44 Using git-update-index to add existing tree objects at other paths Sean Allred
2022-10-04 15:10 ` Chris Torek [this message]
2022-10-05 19:39   ` Junio C Hamano
2022-10-04 15:13 ` Phillip Wood

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPx1GvfsRipG0qgDmMMoU+WCWCEyr4ayJteYWAy+EoJOoaNQXg@mail.gmail.com \
    --to=chris.torek@gmail.com \
    --cc=allred.sean@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).