git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Julius Smith <jos@ccrma.stanford.edu>
Cc: git@vger.kernel.org
Subject: Re: Submodule "git branch" says (HEAD detached at <incorrect-commit>)
Date: Wed, 03 Jul 2019 11:17:41 -0700	[thread overview]
Message-ID: <xmqq7e8z0ypm.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAMPRpjUWBXCEagDB5RwsBTYSJWeypOeY47CGWOO95oZiSCTOjw@mail.gmail.com> (Julius Smith's message of "Wed, 3 Jul 2019 01:28:59 -0700")

Julius Smith <jos@ccrma.stanford.edu> writes:

> "git branch" in the the submodule directory says "(detached from
> <commit-for-D>)" but this seems to be wrong.  I did "git diff
> <commit>" in the submodule directory to show that it was the C-commit
> and not the D-commit as it appeared.  Could "git branch" in the
> submodule directory be referring to the commit at the time it was
> first detached and not updating after a "git submodule update --init"
> in the parent?

There are "detached from" and "detached at" messages.  Their use was
somewhat inconsistent in the older version of Git, but at least
since 2.4.0 (quoting from Documentation/RelNotes/2.4.0.txt):

 * The phrasing "git branch" uses to describe a detached HEAD has been
   updated to agree with the phrasing used by "git status":

    - When HEAD is at the same commit as when it was originally
      detached, they now both show "detached at <commit object name>".

    - When HEAD has moved since it was originally detached, they now
      both show "detached from <commit object name>".

   Previously, "git branch" always used "from".

"git branch" and "git status" should be using the same language to
describe the situation.

  parent reply	other threads:[~2019-07-03 18:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  8:28 Submodule "git branch" says (HEAD detached at <incorrect-commit>) Julius Smith
2019-07-03  8:31 ` Julius Smith
2019-07-03 18:17 ` Junio C Hamano [this message]
2019-07-03 19:00   ` Julius Smith

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=xmqq7e8z0ypm.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jos@ccrma.stanford.edu \
    /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).