git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: Submodule design
Date: Tue, 2 Oct 2012 20:53:28 +0530	[thread overview]
Message-ID: <CALkWK0kYh3tKXRqRO9SFMHkrytmhXFkR3yHwmiTpw6KocuLzZw@mail.gmail.com> (raw)

Hi,

Today I learnt that a gitlink is a commit object embedded in a tree.
However, I can't seem to be able to cat it.

    $ git ls-tree HEAD
    100644 blob 5a91f388f3648b98ae34a19ec42ba9acc7852ef4    .gitmodules
    160000 commit 8daa12004db8862b22f6c7dd244a88ac6108b194  dotfiles
    $ git cat-file 8daa12004db8862b22f6c7dd244a88ac6108b194
    fatal: git cat-file 8daa12004db8862b22f6c7dd244a88ac6108b194: bad file

Why is this?  Does the object not exist in the object store at all?
Then how was it embedded in the toplevel tree object in the first
place?  Also, why (how) does 'git diff' give me the impression that
it's a blob?

    $ git diff
    diff --git a/dotfiles b/dotfiles
    index 8daa120..ff61f40 160000
    --- a/dotfiles
    +++ b/dotfiles
    @@ -1 +1 @@
    -Subproject commit 8daa12004db8862b22f6c7dd244a88ac6108b194
    +Subproject commit ff61f40e0938024aa3b748eb733a974b17082ec2

If it is really a blob, I should be able to stage and unstage it
normally, but the following command is a no-op:

    $ git checkout -- dotfiles

What is going on?  Shouldn't we get rid of these ugly inconsistencies?

Ram

             reply	other threads:[~2012-10-02 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:23 Ramkumar Ramachandra [this message]
2012-10-02 15:38 ` Submodule design Sascha Cunz
2012-10-02 17:49 ` 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

  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=CALkWK0kYh3tKXRqRO9SFMHkrytmhXFkR3yHwmiTpw6KocuLzZw@mail.gmail.com \
    --to=artagnon@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).